Skip to content

Commit 96fa813

Browse files
committed
Fix clis
1 parent 0832331 commit 96fa813

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/superannotate/lib/app/input_converters/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def export_annotation(
224224
def import_annotation(
225225
input_dir,
226226
output_dir,
227-
dataset_format,
227+
dataset_format = "superannotate",
228228
dataset_name="",
229229
project_type="Vector",
230230
task="object_detection",

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,30 +262,33 @@ def _upload_annotations(
262262
if not task:
263263
task = "object_detection"
264264

265+
annotations_path = folder
265266
with tempfile.TemporaryDirectory() as temp_dir:
266-
import_annotation(
267-
input_dir=folder,
268-
output_dir=temp_dir,
269-
dataset_format=format,
270-
dataset_name=data_set_name,
271-
project_type=constances.ProjectType.get_name(
272-
project["project"].project_type
273-
),
274-
task=task,
275-
)
276-
classes_path = f"{temp_dir}/classes/classes.json"
267+
if format != 'SuperAnnotate':
268+
import_annotation(
269+
input_dir=folder,
270+
output_dir=temp_dir,
271+
dataset_format=format,
272+
dataset_name=data_set_name,
273+
project_type=constances.ProjectType.get_name(
274+
project["project"].project_type
275+
),
276+
task=task,
277+
)
278+
annotations_path = temp_dir
279+
classes_path = f"{folder}/classes/classes.json"
277280
self.controller.create_annotation_classes(
278281
project_name=project_name,
279282
annotation_classes=json.load(open(classes_path)),
280283
)
281-
annotation_paths = get_annotation_paths(temp_dir)
284+
annotation_paths = get_annotation_paths(annotations_path)
282285
chunk_size = 10
283286
with tqdm(total=len(annotation_paths)) as progress_bar:
284287
for i in range(0, len(annotation_paths), chunk_size):
285288
response = self.controller.upload_annotations_from_folder(
286289
project_name=project["project"].name,
287290
folder_name=folder_name,
288-
folder_path=temp_dir,
291+
folder_path=annotations_path,
289292
annotation_paths=annotation_paths[
290293
i : i + chunk_size # noqa: E203
291294
],

0 commit comments

Comments
 (0)