Images#

SAClient.download_image(project, image_name, local_dir_path='./', include_annotations=False, include_fuse=False, include_overlay=False, variant='original')#

Downloads the image (and annotation if not None) to local_dir_path

Parameters:
  • project (str) – project name or folder path (e.g., “project1/folder1”)

  • image_name (str) – image name

  • local_dir_path (Path-like (str or Path)) – where to download the image

  • include_annotations (bool) – enables annotation download with the image

  • include_fuse (bool) – enables fuse image download with the image

  • include_overlay (bool) – enables overlay image download with the image

  • variant (str) – which resolution to download, can be ‘original’ or ‘lores’ (low resolution used in web editor)

Returns:

paths of downloaded image and annotations if included

Return type:

tuple

SAClient.download_image_annotations(project, image_name, local_dir_path)#

Downloads annotations of the image (JSON and mask if pixel type project) to local_dir_path.

Parameters:
  • project (str) – project name or folder path (e.g., “project1/folder1”)

  • image_name (str) – image name

  • local_dir_path (Path-like (str or Path)) – local directory path to download to

Returns:

paths of downloaded annotations

Return type:

tuple

SAClient.upload_image_annotations(project, image_name, annotation_json, mask=None, verbose=True, keep_status=None)#

Upload annotations from JSON (also mask for pixel annotations) to the image.

Parameters:
  • project (str) – project name or folder path (e.g., “project1/folder1”)

  • image_name (str) – image name

  • annotation_json (dict or Path-like (str or Path)) – annotations in SuperAnnotate format JSON dict or path to JSON file

  • mask (BytesIO or Path-like (str or Path)) – BytesIO object or filepath to mask annotation for pixel projects in SuperAnnotate format

  • verbose (bool) – Turns on verbose output logging during the proces.

  • keep_status (bool) – If False, the annotation status will be automatically updated to “InProgress,” otherwise the current status will be kept.

SAClient.pin_image(project, image_name, pin=True)#

Pins (or unpins) image

Parameters:
  • project (str) – project name or folder path (e.g., “project1/folder1”)

  • image_name (str) – image name

  • pin (bool) – sets to pin if True, else unpins image

SAClient.upload_priority_scores(project, scores)#

Upload priority scores for the given list of items.

Parameters:
  • project (str) – project name or folder path (e.g., “project1/folder1”)

  • scores (list of dicts) – list of score objects

Returns:

lists of uploaded, skipped items

Return type:

tuple (2 members) of lists of strs