anatools.anaclient.annotations module¶
Annotations Functions
- create_annotation(self, datasetId, format, mapId=None, tags=None, workspaceId=None)¶
Generates annotations for an existing dataset.
- Parameters
datasetId (str) – Dataset ID to generate annotation for.
format (str) – Annotation format to use.
mapId (str) – The ID of the map file used for annotations.
tags (list[str]) – Tags to apply to the annotation.
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_annotation_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_annotation_map(self, mapId)¶
Deletes the annotation map.
- Parameters
mapId (str) – The ID of a specific Map to delete.
- Returns
Returns True if the map was deleted.
- Return type
bool
- download_annotation(self, 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_annotation_map(self, mapId, localDir=None)¶
Download the annotation map file from your organization.
- Parameters
mapId (str) – MapId to download.
localDir (str) – Path for where to download the annotation map. If none is provided, current working directory will be used.
- Returns
The name of the map file that got downloaded.
- Return type
str
- edit_annotation(self, annotationId, tags=None, workspaceId=None)¶
Edits annotations for a dataset.
- Parameters
annotationId (str) – Annotation ID for the annotation to edit.
tags (list[str]) – Tags for the annotation job.
workspaceId (str) – Workspace ID where the annotation exist. If none is provided, the current workspace will get used.
- Returns
If true, successfully edited the annotation.
- Return type
bool
- edit_annotation_map(self, mapId, name=None, description=None, tags=None)¶
Edits the name, description or tags of a map file.
- Parameters
mapId (str) – The mapId that will be updated.
name (str) – The new name of the annotation map. Note: this name needs to be unique per organization.
description (str) – Description of the annotation map.
tags (list[str]) – Tags to apply to the map.
- Returns
Returns True if the map was edited.
- Return type
bool
- get_annotation_formats(self)¶
Retrieves the annotation formats supported by the Rendered.ai Platform.
- Returns
The annotation formats supported.
- Return type
list[str]
- get_annotation_maps(self, organizationId=None, workspaceId=None, mapId=None, cursor=None, limit=None, filters=None, fields=None)¶
Retrieves annotation map information. If neither organizationId or workspaceId are specified, it will use the current workspace.
- Parameters
organizationId (str) – Organization ID to retrieve maps for.
workspaceId (str) – Workspace ID to retrieve maps for.
mapId (str) – Annotation map ID to retrieve.
cursor (str) – Cursor for pagination.
limit (int) – Maximum number of maps to return.
filters (dict) – Filters that limit output to entries that match the filter
fields (list[str]) – List of fields to return, leave empty to get all fields.
- Returns
The requested annotation maps.
- Return type
list[dict]
- get_annotations(self, datasetId=None, annotationId=None, workspaceId=None, cursor=None, limit=None, filters=None, fields=None)¶
Retrieve information about existing annotations generated for a dataset.
- 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.
cursor (str) – Cursor for pagination.
limit (int) – Maximum number of annotations to return.
filters (dict) – Filters that limit output to entries that match the filter.
fields (list[str]) – List of fields to return, leave empty to get all fields.
- Returns
Annotation information.
- Return type
list[dict]