SuperAnnotate Docs

Find how you can upload images from your computer or the cloud.

Upload images

Computer

To upload a list of image paths:

project_metadata = sa.get_project_metadata("Lane Annotation")

uploaded, skipped, duplicate = sa.upload_images_to_project(
    project = project_name,
    img_paths = ["1.jpg", "100.jpg", "1000.jpg"])

To upload a local image folder:

uploaded, skipped, duplicate = sa.upload_images_from_folder_to_project(
        project = project_name,
        folder_path = "./images")
superannotatecli upload-images --project "Lane Annotation" --folder "./images"

To upload images and set annotation status:

uploaded, skipped, duplicate = sa.upload_images_from_folder_to_project(
    project = project_name,
    folder_path = "./images",
    annotation_status = "QualityCheck")

To enable recursive subfolder upload:

uploaded, skipped, duplicate = sa.upload_images_from_folder_to_project(
    project = project_name,
    folder_path = "./images",
    recursive_subfolders = True)

AWS S3

Enter the bucket name and the S3 folder path:

uploaded, skipped, duplicate = sa.upload_images_from_folder_to_project(
    project = project_name,
    folder_path = "./images",
    from_s3_bucket = "s3 bucket name")

Google Cloud

Enter the names of your Google project and bucket, and specify the folder path:

uploaded, skipped, duplicate = sa.upload_images_from_google_cloud_to_project(
    project = project_name,
    google_project = "gcloud project name",
    folder_path = "./images",
    bucket_name = "gcloud bucket_name"
)

Microsoft Azure

Enter the container name and the folder path:

uploaded, skipped, duplicate = sa.upload_images_from_azure_blob_to_project(
    project = project_name,
    container_name = "azure container name",
    folder_path = "./images")

Public URLs

You can upload images from public URLs. To do that, add the URLs in the img_urls parameter:

uploaded, skipped, duplicate = sa.upload_images_from_public_urls_to_project(
    project = project_name,
    img_urls =['https://www.pexels.com/photo/5450829/download/','https://www.pexels.com/photo/3702354/download/'])

Attach images

To attach image URLs:

superannotate.attach_image_urls_to_project(
    project = project_name, 
    attachments = "images.csv",
    annotation_status = "QualityCheck")
superannotatecli attach-image-urls --project <project_name> --attachments <csv_path> [--annotation_status <annotation_status>]

Manage images

To copy images to other projects:

qa_images = sa.search_images(
    project = project_name,
    annotation_status = "QualityCheck")

for image_name in qa_images:
    sa.copy_image(
      source_project = project_name, 
        image_name = image_name, 
        destination_project = "{} {}".format("QA", project_name),
        include_annotations=False, 
        copy_annotation_status=True, 
        copy_pin=False)

❗️

You cannot copy more than 50,000 images to other projects. The remaining images will be skipped.

📘

If you want to upload more than 50,000 images to your project, you can do so by creating multiple folders. For example, if you need to upload 100,000 images, you can create two folders and upload 50,000 images to each folder.

To move images to other projects:

sa.move_image(
    source_project = project_name, 
    image_name = image_name, 
    destination_project = "{} {}".format("QA", project_name),
    include_annotations=False,
    copy_annotation_status=True,
    copy_pin=False)

To download an image and its annotations:

image_path, annotation_path = sa.download_image(
    project = project_name,
    image_name = image_name,
    local_dir_path='.',
    include_annotations=True,
    include_fuse=False)

Filter images

To filter images in the project by name and annotation status:

filtered_images = sa.search_images(
    project = project_name,
    annotation_status = "Completed",
    image_name_prefix = "1000")

You can filter images by tags and comments. To do that, follow these steps:

  1. Export the project to the local directory:
project_export = sa.prepare_export(project = project_name)

export_dir = "./project_export"
sa.download_export(
    project = project_name,
    export = project_export,
    folder_path = export_dir)
  1. Convert the annotations into pandas dataframe:
df = sa.aggregate_annotations_as_df(
  project_root = project_export, 
  include_comments=False, 
  include_tags=True)
  1. Filter images by comments:
tagged_images = sa.filter_images_by_comments(
    annotations_df = df,
    include_unresolved_comments=True,
    include_resolved_comments=False)
  1. Filter images by tags:
commented_images = sa.filter_images_by_tags(
    annotations_df = df,
    include = ["dog", "cat"],
    exclude = ["person"])

Manage metadata

Use the following functions to set image metadata, including annotation statuses, assignees, and more.

To assign images in bulk:

qa_images = sa.search_images(
    project = project_name,
    annotation_status = "QualityCheck")

sa.assign_images(
    project = project_name,
    image_names = qa_images,
    user = "[email protected]")

To update annotation statuses in bulk:

sa.set_images_annotation_statuses(
    project = project_name, 
    image_names = qa_images,
    annotation_status = "Returned")

To pin a list of images:

for image_name in qa_images:
  sa.pin_image(
    project = project_name,
    image_name = image_name,
    pin=True)

Updated 2 months ago


Images


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.