Skip to content

Commit 9c988f5

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
tod
1 parent c285f0c commit 9c988f5

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/superannotate/lib/app/interface/cli_interface.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pathlib import Path
1212
from typing import Any
1313
from typing import Optional
14+
from tqdm import tqdm
1415

1516
import lib.core as constances
1617
import pandas as pd
@@ -152,17 +153,19 @@ def upload_image(image_path: str):
152153
set(filtered_paths),
153154
[item for item in duplication_counter if duplication_counter[item] > 1],
154155
)
155-
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
156-
results = [
157-
executor.submit(upload_image, image_path)
158-
for image_path in images_to_upload
159-
]
160-
for future in concurrent.futures.as_completed(results):
161-
processed_image = future.result()
162-
if processed_image.uploaded and processed_image.entity:
163-
uploaded_image_entities.append(processed_image.entity)
164-
else:
165-
failed_images.append(processed_image.path)
156+
with tqdm(total=len(images_to_upload)) as progress_bar:
157+
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
158+
results = [
159+
executor.submit(upload_image, image_path)
160+
for image_path in images_to_upload
161+
]
162+
for future in concurrent.futures.as_completed(results):
163+
processed_image = future.result()
164+
if processed_image.uploaded and processed_image.entity:
165+
uploaded_image_entities.append(processed_image.entity)
166+
else:
167+
failed_images.append(processed_image.path)
168+
progress_bar.update(1)
166169

167170
for i in range(0, len(uploaded_image_entities), 500):
168171
self.controller.upload_images(
@@ -248,7 +251,7 @@ def _upload_annotations(
248251
project_name, folder_name = split_project_path(project)
249252
project = self.controller.get_project_metadata(project_name=project_name).data
250253
if not format:
251-
format = "COCO"
254+
format = "SuperAnnotate"
252255
if not data_set_name and format == "COCO":
253256
raise Exception("Data-set name is required")
254257
elif not data_set_name:

0 commit comments

Comments
 (0)