@@ -346,7 +346,9 @@ def __image_upload(
346346
347347 return response
348348
349- def __annotation_upload (self , annotation_path : str , image_id : str , is_prediction : bool = False ):
349+ def __annotation_upload (
350+ self , annotation_path : str , image_id : str , is_prediction : bool = False
351+ ):
350352 """function to upload annotation to the specific project
351353 :param annotation_path: path to annotation you'd like to upload
352354 :param image_id: image id you'd like to upload that has annotations for it.
@@ -389,7 +391,7 @@ def __annotation_upload(self, annotation_path: str, image_id: str, is_prediction
389391 "?api_key=" ,
390392 self .__api_key ,
391393 "&name=" + os .path .basename (annotation_path ),
392- "&is_prediction=true" if is_prediction else ""
394+ "&is_prediction=true" if is_prediction else "" ,
393395 ]
394396 )
395397
@@ -479,6 +481,7 @@ def upload(
479481 is_prediction = is_prediction ,
480482 ** kwargs ,
481483 )
484+
482485 else :
483486 images = os .listdir (image_path )
484487 for image in images :
@@ -578,7 +581,9 @@ def single_upload(
578581 # Upload only annotations to image based on image Id (no image)
579582 if annotation_path is not None and image_id is not None and success :
580583 # Get annotation upload response
581- annotation_response = self .__annotation_upload (annotation_path , image_id , is_prediction = is_prediction )
584+ annotation_response = self .__annotation_upload (
585+ annotation_path , image_id , is_prediction = is_prediction
586+ )
582587 # Check if upload was a success
583588 try :
584589 response_data = annotation_response .json ()
0 commit comments