anatools.anaclient.annotations module

Annotations Functions

create_annotation(self, datasetId, format, map, workspaceId=None)

Generates annotations for an existing dataset.

Parameters:
  • datasetId (str) – Dataset ID to generate annotation for.

  • format (str) – Annotation format. Call get_annotation_formats() to find supported formats.

  • map (str) – The map file used for annotations. Call get_annotation_maps() to find supported maps.

  • workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.

Returns:

The annotationsId for the annotation job.

Return type:

str

create_managed_map(self, name, description, mapfile, organizationId=None)

Uploades an annotation map to the microservice. The map will be owned by the specified organization. If not organizationId is given the model will be owned by that of the analcient.

Parameters:
  • name (str) – A name for map.

  • description (str) – Details about the map.

  • mapfile (str) – The map file - relative to the local directry.

  • organizationId (str) – Id of organization that owns the map, that of the anaclient if not given.

Returns:

mapId – The unique identifier for this map.

Return type:

str

delete_annotation(self, annotationId, workspaceId=None)

Delete a dataset annotation.

Parameters:
  • annotationId (str) – AnnoationId of the annotation job.

  • workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.

Returns:

If true, successfully deleted the annotation.

Return type:

bool

delete_managed_map(self, mapId)

Removes the managed map

Parameters:

mapId (str) – The ID of a specific Map to delete.

Returns:

Status

Return type:

bool

download_annotation(self, datasetId, annotationId, workspaceId=None)

Downloads annotations archive.

Parameters:
  • datasetId (str) – Dataset ID to download image annotation for.

  • annotationId (str) – Id of previously generated image annotation.

  • workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.

Returns:

The name of the archive file that got downloaded.

Return type:

str

download_managed_map(self, mapId, localDir=None)

Download the managed annotation map file from your organization.

Parameters:
  • mapId (str) – MapId to download.

  • localDir (str) – Path for where to download the managed annotation map. If none is provided, current working directory will be used.

Returns:

The name of the managed map file that got downloaded.

Return type:

str

edit_managed_map(self, mapId, name=None, description=None)

Edits the name of a managed map.

Parameters:
  • mapId (str) – The mapId that will be updated.

  • name (str) – The new name of the managed map. Note: this name needs to be unique per organization.

  • description (str) – Description of the managed map

Returns:

Status

Return type:

bool

get_annotation_formats(self)

Retrieves the annotation formats supported by the Platform.

Returns:

The annotation formats supported by the Platform.

Return type:

str

get_annotation_maps(self, organizationId=None, workspaceId=None, mapId=None)

Retrieves annotation maps.

Parameters:
  • organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.

  • workspaceId (str) – Workspace ID to retrieve maps for. If not specified then the current workspace is used.

  • mapId (str) – Annotation map ID to retrieve

Returns:

The requested annotation maps.

Return type:

str

get_annotations(self, datasetId=None, annotationId=None, workspaceId=None)

Retrieve information about existing annotations generated for a dataset. Querying requires both datasetId and annotationId.

Parameters:
  • datasetId (str) – Dataset ID to generate annotations for.

  • annotationId (str) – Annotation ID for a specific annotations job.

  • workspaceId (str) – Workspace ID where the annotations exist. If none is provided, the current workspace will get used.

Returns:

Annotation information.

Return type:

list[dict]

get_managed_maps(self, organizationId=None, mapId=None)

Retrieves the map(s) managed by the organization

Parameters:
  • organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.

  • mapId (str) – Annotation map ID to retrieve

Returns:

The requested annotation maps.

Return type:

str