@@ -520,60 +520,6 @@ def copy_image(
520520 )
521521
522522
523- @Trackable
524- @validate_arguments
525- def upload_images_from_public_urls_to_project (
526- project : Union [NotEmptyStr , dict ],
527- img_urls : List [NotEmptyStr ],
528- img_names : Optional [List [NotEmptyStr ]] = None ,
529- annotation_status : Optional [AnnotationStatuses ] = "NotStarted" ,
530- image_quality_in_editor : Optional [NotEmptyStr ] = None ,
531- ):
532- """Uploads all images given in the list of URL strings in img_urls to the project.
533- Sets status of all the uploaded images to annotation_status if it is not None.
534-
535- :param project: project name or folder path (e.g., "project1/folder1")
536- :type project: str
537- :param img_urls: list of str objects to upload
538- :type img_urls: list
539- :param img_names: list of str names for each urls in img_url list
540- :type img_names: list
541- :param annotation_status: value to set the annotation statuses of the uploaded images
542- NotStarted InProgress QualityCheck Returned Completed Skipped
543- :type annotation_status: str
544- :param image_quality_in_editor: image quality be seen in SuperAnnotate web annotation editor.
545- Can be either "compressed" or "original". If None then the default value in project settings will be used.
546- :type image_quality_in_editor: str
547-
548- :return: uploaded images' urls, uploaded images' filenames, duplicate images' filenames
549- and not-uploaded images' urls
550- :rtype: tuple of list of strs
551- """
552- warning_msg = (
553- "The upload_images_from_public_urls function is deprecated and will be removed with the coming release, "
554- "please use attach_image_urls_to_project instead."
555- )
556- logger .warning (warning_msg )
557- warnings .warn (warning_msg , DeprecationWarning )
558-
559- project_name , folder_name = extract_project_folder (project )
560-
561- use_case = Controller .get_default ().upload_images_from_public_urls_to_project (
562- project_name = project_name ,
563- folder_name = folder_name ,
564- image_urls = img_urls ,
565- image_names = img_names ,
566- annotation_status = annotation_status ,
567- image_quality_in_editor = image_quality_in_editor ,
568- )
569- if use_case .is_valid ():
570- with tqdm (total = len (img_urls ), desc = "Uploading images" ) as progress_bar :
571- for _ in use_case .execute ():
572- progress_bar .update (1 )
573- return use_case .data
574- raise AppException (use_case .response .errors )
575-
576-
577523@Trackable
578524@validate_arguments
579525def copy_images (
0 commit comments