@@ -2355,6 +2355,7 @@ def attach_image_urls_to_project(
23552355 raise AppException (use_case .response .errors )
23562356
23572357
2358+ @Trackable
23582359@validate_arguments
23592360def attach_video_urls_to_project (
23602361 project : Union [NotEmptyStr , dict ],
@@ -2476,6 +2477,7 @@ def upload_annotations_from_folder_to_project(
24762477 folder_name = folder_name ,
24772478 annotation_paths = annotation_paths , # noqa: E203
24782479 client_s3_bucket = from_s3_bucket ,
2480+ folder_path = folder_path ,
24792481 )
24802482 if response .errors :
24812483 raise AppException (response .errors )
@@ -3069,7 +3071,12 @@ def add_annotation_bbox_to_image(
30693071 """
30703072 annotations = get_image_annotations (project , image_name )["annotation_json" ]
30713073 annotations = add_annotation_bbox_to_json (
3072- annotations , bbox , annotation_class_name , annotation_class_attributes , error ,
3074+ annotations ,
3075+ bbox ,
3076+ annotation_class_name ,
3077+ annotation_class_attributes ,
3078+ error ,
3079+ image_name ,
30733080 )
30743081 upload_image_annotations (project , image_name , annotations , verbose = False )
30753082
@@ -3638,12 +3645,23 @@ def attach_document_urls_to_project(
36383645def validate_annotations (
36393646 project_type : ProjectTypes , annotations_json : Union [NotEmptyStr , Path ]
36403647):
3648+ """
3649+ Validates given annotation JSON.
3650+ :param project_type: project_type (str) – the project type Vector, Pixel, Video or Document
3651+ :type project_type: str
3652+ :param annotations_json: path to annotation JSON
3653+ :type annotations_json: Path-like (str or Path)
3654+
3655+ :return: The success of the validation
3656+ :rtype: bool
3657+ """
36413658 with open (annotations_json ) as file :
36423659 annotation_data = json .loads (file .read ())
3643- response = controller .validate_annotations (project_type , annotation_data )
3660+ response = controller .validate_annotations (project_type , annotation_data , allow_extra = False )
36443661 if response .errors :
36453662 raise AppException (response .errors )
3646- if response .data :
3663+ is_valid , _ = response .data
3664+ if is_valid :
36473665 return True
36483666 print (response .report )
36493667 return False
0 commit comments