anatools.anaclient.annotations module

Annotations Functions

add_map_organization(self, mapId, organizationId)

Add access to a map for an organization.

Parameters
  • mapId (str) – MapId to add access for.

  • organizationId (str) – Organization ID to add access

Returns

Status

Return type

bool

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

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

remove_map_organization(self, mapId, organizationId)

Remove access to a map for an organization.

Parameters
  • mapId (str) – MapId to remove access to.

  • organizationId (str) – Organization ID to remove access.

Returns

Status

Return type

bool