Upload images from a local storage

Upload local image folder

To upload images from a folder:

sa.upload_images_from_folder_to_project(
    project = "Project Name",
    folder_path = "./data/images")
superannotatecli upload-images --project “Project Name” --folder “./data/images”

Upload images to a folder in a project

To upload images to a folder in a project:

sa.upload_images_from_folder_to_project(
    project = "Project Name/Folder Name",
    folder_path = "./data/images")

📘

The syntax of project and folder paths is used across all SDK functions.

🚧

When you upload images to a project, their status is NotStarted by default.

Set the annotation status of uploaded images

To set the annotation status of the images you want to upload:

sa.upload_images_from_folder_to_project(
    project = "Project Name",
    folder_path = "./data/images",
    annotation_status = "QualityCheck")

Recursive subfolder upload

To enable recursive subfolder upload (when the images are stored in multiple subfolders):

sa.upload_images_from_folder_to_project(
    project = "Project Name",
    folder_path = "./data/images",
    annotation_status = "QualityCheck", 
    recursive_subfolders = True)

📘

  • This function returns lists of uploaded, skipped, and failed to upload image names.
  • Images with existing names will be skipped (not uploaded).

Upload a predefined list of image paths

To upload a predefined list of image paths:

sa.upload_images_to_project(
    Project = "Project Name",
    img_paths = ["./data/images/1.png", "./data/images/100.png"],
    annotation_status = "QualityCheck")

Upload images from a cloud storage

AWS

To upload an image folder from AWS, type the names of your S3 bucket and the AWS access keys:

sa.upload_images_from_s3_bucket_to_project( 
    project = "Project Name",
    accessKeyId = "AKIAZWYSN2NJJQF2ds",
    secretAccessKey = "qi+PpG714Gvzf/shdjs",
    bucket_name = "Bucket Name",
    folder_path = "./data/images")

G-Cloud

To upload an image folder from G-Cloud, type the names of your Google project and bucket:

sa.upload_images_from_google_cloud_to_project(
    project = "Project Name",
    google_project = "Google Project Name",
    bucket_name = "Bucket Name",
    folder_path = "./data/images")

Azure

To upload an image folder from Azure, type the name of your Azure container:

sa.upload_images_from_azure_blob_to_project(
    project = "Project Name",
    container_name = "Container Name",
    folder_path = "./data/images/")

Public URLs

To upload images using public URLs, provide the list of image URLs and the corresponding list of image names that'll be displayed in the platform:

sa.upload_images_from_public_urls_to_project(
    project = "Project Name", 
    img_urls = ["https://en.wikipedia.org/wiki/File:Palestine_sunbird_(Cinnyris_osea_osea)_male.jpg"], 
    img_names= ["cinnyris.jpg"])

Attach images URLs

You can import images by linking them from external storages. The linked images are displayed in SuperAnnotate, but they aren't stored on our local servers. Learn more here.

sa.attach_image_urls_to_project(
    project = "Project Name", 
    attachments = "./images.csv",
    annotation_status = "QualityCheck")
superannotatecli attach-image-urls --project “Project Name/Folder Name” --attachments “./images.csv” --annotation_status “QualityCheck”

Did this page help you?