SuperAnnotate Docs

To set up a project with SuperAnnotate, use the following pipeline:

  1. Create a project:
import superannotate as sa

project_name = "Lane Annotation"

project_metadata = sa.create_project(
    project_name = project_name, 
    project_description = "Polyline Annotation", 
    project_type = "Vector")
superannotatecli create-project --name "Lane Annotation" --description "Polyline Annotation" --type "Vector"

and retrieve dictionary on project metadata:

   'name': 'Lane Annotation', 
   'description': 'Polyline Annotation', 
   'type': 'Vector', 
   'creator_id': '[email protected]', 
   'updatedAt': '2021-03-17T13:17:49.167Z', 
   'createdAt': '2021-03-17T13:17:49.167Z',
   'attachment_name': None, 
   'attachment_path': None, 
   'entropy_status': 1, 
   'id': 38959, 
   'team_id': 2665,
   'status': 0


project_type options

The project type can take one of the three following options: vector, pixel, and video (coming soon).

  1. Create annotation classes:
class_metadata = sa.create_annotation_class(
    project = project_name,
    name = "Lane",
    color = "#FF0000")
  1. Upload images:
uploaded, skipped, duplicates = sa.upload_images_from_folder_to_project(
    project = project_name,
    folder_path = "./data/cityscapes",
    extensions = ["jpg", "png"],
    recursive_subfolders = True)
superannotatecli upload-images --project "Lane Annotation" --folder "./data/cityscapes" --extensions jpg,png --recursive

Share Project

To share a project with your team:

  1. Get the list of team contributors:
team_metadata = sa.get_team_metadata(convert_users_role_to_string = True)
team_members = team_metadata["users"]
  1. Share your project with your team's annotators:
for member_metadata in team_members:
    if member_metadata["user_role"] == "Annotator":
            project = project_name, 
            user = member_metadata["email"],
            user_role = "Annotator")

Clone Project

To clone a project:

  1. Clone a project setup:
source_project_name = project_metadata["name"]
taget_project_name = "{}_copy".format(source_project_name)
target_project_description = "clone project from {}".format(source_project_name)

    project_name = target_project_name,
    from_project = source_project_name,
    project_description = target_project_description,
    copy_annotation_classes = True,
    copy_settings = True,
    copy_workflow = False,
    copy_contributors = False)
  1. Copy images:
images = sa.search_images(project = source_project_name)

for image_name in images:
    source_project = source_project_name,
    destination_project = destination_project_name,
    image_name = image_name

Export Project

To export a project, prepare and download the export:

project_export = sa.prepare_export(
    project = project_name,
    annotation_statuses = ["Completed", "Returned"],
    include_fuse = True)

export_dir = "./project_export"
    project = project_name,
    export = project_export, 
    include_fuse = True,
    folder_path = export_dir)
superannotatecli export-project --project "Lane Annotation" --folder "./project_export" --annotation-statuses "Completed" --include-fuse

Migrate Project

To migrate a project:

  1. Initialize the SDK with the target account token:
import json

with open("./target_token.json") as tj:
    token = {"token": {{target token}}}

superannotatecli init
File ~/.superannotate/config.json exists. Do you want to overwrite? [y/n] : y
Input the team SDK token from : *****
SA-PYTHON-SDK - INFO - Configuration file ~/.superannotate/config.json successfully updated.
  1. Migrate project metadata:
  1. Migrate project data
classes_path = "{}/classes/classes.json".format(export_dir)
    project = project_name,
    classes_json = classes_path)
    project = project_name,
    folder_path = export_dir)
    project = project_name,
    folder_path = export_dir))

Updated about a month ago


Suggested Edits are limited on API Reference Pages

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