@@ -390,7 +390,7 @@ def delete_folders(project: str, folder_names: List[str]):
390390
391391
392392@Trackable
393- @validate_input
393+ # @validate_input
394394def get_project_and_folder_metadata (project : Union [str , dict ]):
395395 """Returns project and folder metadata tuple. If folder part is empty,
396396 than returned folder part is set to None.
@@ -884,7 +884,9 @@ def get_project_settings(project: Union[str, dict]):
884884 """
885885 project_name , folder_name = extract_project_folder (project )
886886 settings = controller .get_project_settings (project_name = project_name )
887- settings = [BaseSerializers (attribute ).serialize () for attribute in settings .data ]
887+ settings = [
888+ SettingsSerializer (attribute ).serialize () for attribute in settings .data
889+ ]
888890 return settings
889891
890892
@@ -2487,20 +2489,22 @@ def upload_annotations_from_folder_to_project(
24872489 failed_annotations = []
24882490 missing_annotations = []
24892491 chunk_size = 10
2490- for i in tqdm (range (0 , len (annotation_paths ), chunk_size )):
2491- response = controller .upload_annotations_from_folder (
2492- project_name = project_name ,
2493- folder_name = folder_name ,
2494- folder_path = folder_path ,
2495- annotation_paths = annotation_paths [i : i + chunk_size ], # noqa: E203
2496- client_s3_bucket = from_s3_bucket ,
2497- )
2498- if response .errors :
2499- logger .warning (response .errors )
2500- if response .data :
2501- uploaded_annotations .extend (response .data [0 ])
2502- missing_annotations .extend (response .data [1 ])
2503- failed_annotations .extend (response .data [2 ])
2492+ with tqdm (total = len (annotation_paths )) as progress_bar :
2493+ for i in range (0 , len (annotation_paths ), chunk_size ):
2494+ response = controller .upload_annotations_from_folder (
2495+ project_name = project_name ,
2496+ folder_name = folder_name ,
2497+ folder_path = folder_path ,
2498+ annotation_paths = annotation_paths [i : i + chunk_size ], # noqa: E203
2499+ client_s3_bucket = from_s3_bucket ,
2500+ )
2501+ if response .errors :
2502+ logger .warning (response .errors )
2503+ if response .data :
2504+ uploaded_annotations .extend (response .data [0 ])
2505+ missing_annotations .extend (response .data [1 ])
2506+ failed_annotations .extend (response .data [2 ])
2507+ progress_bar .update (chunk_size )
25042508 return uploaded_annotations , failed_annotations , missing_annotations
25052509
25062510
0 commit comments