@@ -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