@@ -266,7 +266,8 @@ def upload_video_to_project(
266266 if "ffprobe" in str (e ):
267267 warning_str = "This could be because ffmpeg package is not installed. To install it, run: sudo apt install ffmpeg"
268268 logger .warning (
269- "Couldn't read video metadata to determine rotation. " + warning_str
269+ "Couldn't read video metadata to determine rotation. %s" ,
270+ warning_str
270271 )
271272
272273 video = cv2 .VideoCapture (str (video_path ), cv2 .CAP_FFMPEG )
@@ -340,7 +341,7 @@ def upload_video_to_project(
340341 )
341342
342343 filenames = upload_images_from_folder_to_project (
343- project ,
344+ ( project , project_folder ) ,
344345 tempdir .name ,
345346 extensions = ["jpg" ],
346347 annotation_status = annotation_status ,
@@ -767,9 +768,6 @@ def __create_image(
767768 "team_id" : str (team_id ),
768769 "images" : [],
769770 "annotation_status" : annotation_status ,
770- "team_id" : str (team_id ),
771- "images" : [],
772- "annotation_status" : annotation_status ,
773771 "meta" : {},
774772 "upload_state" : upload_state_code
775773 }
@@ -1086,7 +1084,7 @@ def __attach_image_urls_to_project_thread(
10861084 for i in range (start_index , end_index ):
10871085 if i >= len_img_paths :
10881086 break
1089- name , url = img_names_urls [i ]
1087+ name , _ = img_names_urls [i ]
10901088 tried_upload [thread_id ].append (name )
10911089 img_name_hash = str (uuid .uuid4 ()) + Path (name ).suffix
10921090 key = prefix + img_name_hash
@@ -1190,7 +1188,7 @@ def upload_images_from_public_urls_to_project(
11901188 ),
11911189 daemon = True
11921190 )
1193- logger .info ('Downloading %s images' % len (img_urls ))
1191+ logger .info ('Downloading %s images' , len (img_urls ))
11941192 tqdm_thread .start ()
11951193 with tempfile .TemporaryDirectory () as save_dir_name :
11961194 save_dir = Path (save_dir_name )
@@ -1227,7 +1225,7 @@ def upload_images_from_public_urls_to_project(
12271225 finish_event .set ()
12281226 tqdm_thread .join ()
12291227 images_uploaded_paths , images_not_uploaded_paths , duplicate_images_paths = upload_images_to_project (
1230- project ,
1228+ ( project , project_folder ) ,
12311229 images_to_upload ,
12321230 annotation_status = annotation_status ,
12331231 image_quality_in_editor = image_quality_in_editor
@@ -1313,7 +1311,7 @@ def upload_images_from_google_cloud_to_project(
13131311 path_to_url [str (image_save_pth )] = image_blob .name
13141312 images_to_upload .append (image_save_pth )
13151313 images_uploaded_paths , images_not_uploaded_paths , duplicate_images_paths = upload_images_to_project (
1316- project ,
1314+ ( project , project_folder ) ,
13171315 images_to_upload ,
13181316 annotation_status = annotation_status ,
13191317 image_quality_in_editor = image_quality_in_editor
@@ -1409,7 +1407,7 @@ def upload_images_from_azure_blob_to_project(
14091407 path_to_url [str (image_save_pth )] = image_blob .name
14101408 images_to_upload .append (image_save_pth )
14111409 images_uploaded_paths , images_not_uploaded_paths , duplicate_images_paths = upload_images_to_project (
1412- project ,
1410+ ( project , project_folder ) ,
14131411 images_to_upload ,
14141412 annotation_status = annotation_status ,
14151413 image_quality_in_editor = image_quality_in_editor
@@ -2229,11 +2227,10 @@ def get_project_default_image_quality_in_editor(project):
22292227 for setting in get_project_settings (project ):
22302228 if "attribute" in setting and setting ["attribute" ] == "ImageQuality" :
22312229 return setting ["value" ]
2232- else :
2233- raise SABaseException (
2234- 0 ,
2235- "Image quality in editor should be 'compressed', 'original' or None for project settings value"
2236- )
2230+ raise SABaseException (
2231+ 0 ,
2232+ "Image quality in editor should be 'compressed', 'original' or None for project settings value"
2233+ )
22372234
22382235
22392236def get_project_metadata (
0 commit comments