Annotation set
Annotation set is a collection of annotations for a dataset. Use the Annotation set class to easily manipulate annotations across the whole dataset.
An annotation set is defined by:
-
a task
-
a reference dataset
-
the collection of image-level annotations
class remo.AnnotationSet¶
Remo annotation set
documentation
class remo.AnnotationSet(id: int = None, name: str = None, task: str = None, dataset_id: int = None, total_classes=None, updated_at=None, released_at=None, total_images: int = None, top3_classes=None, total_annotation_objects: int = None, \*\*kwargs)
-
Parameters
-
id – annotation set id
-
name – annotation set name
-
task – annotation task. See also:
remo.task
-
dataset_id – dataset id
-
total_classes – total annotation classes
-
updated_at – date, when annotation set was last updated
-
released_at – annotation set release date
-
total_images – total number of images
-
top3_classes – top 3 classes in annotation set
-
total_annotation_objects – total number of annotation objects in annotation set
-
add_annotations¶
Upload of annotations to the annotation set.
Example::
urls = [‘[https://remo-scripts.s3-eu-west-1.amazonaws.com/open_images_sample_dataset.zip](https://remo-scripts.s3-eu-west-1.amazonaws.com/open_images_sample_dataset.zip)’]
ds = remo.create_dataset(name = ‘D1’, urls = urls)
ann_set = ds.create_annotation_set(annotation_task = ‘Object Detection’, name = ‘test_set’)
image_name = ‘000a1249af2bc5f0.jpg’
annotations = []
annotation = remo.Annotation()
annotation.img_filename = image_name
annotation.classes=’Human hand’
annotation.bbox=[227, 284, 678, 674]
annotations.append(annotation)
annotation = remo.Annotation()
annotation.img_filename = image_name
annotation.classes=’Fashion accessory’
annotation.bbox=[496, 322, 544,370]
annotations.append(annotation)
ann_set.add_annotations(annotations)
documentation
add_annotations(annotations: List[remo.domain.annotation.Annotation])
-
Parameters
annotations – list of Annotation objects
add_image_annotation¶
Adds new annotation to the image
documentation
add_image_annotation(image_id: int, annotation: remo.domain.annotation.Annotation)
-
Parameters
-
image_id – image id
-
annotation – annotation data
-
classes¶
List classes within the annotation set
documentation
classes()
-
Returns
List of classes
export_annotations_to_file¶
Exports annotations in a given format and saves it to a file. If export_tags = True, output_file needs to be a .zip file.
It offers some convenient export options, including:
-
Methods to append the full_path to image filenames,
-
Choose between coordinates in pixels or percentages,
-
Export tags to a separate file
-
Export annotations filtered by user-determined tags.
documentation
export_annotations_to_file(output_file: str, annotation_format: str = 'json', export_coordinates: str = 'pixel', append_path: bool = True, export_tags: bool = True, filter_by_tags: list = None)
-
Parameters
-
output_file – output file to save. Includes file extension and can include file path. If export_tags = True, output_file needs to be a .zip file
-
annotation_format – can be one of [‘json’, ‘coco’, ‘csv’]. Default=’json’
-
append_path – if True, appends the path to the filename (e.g. local path). Default: True
-
export_coordinates – converts output values to percentage or pixels, can be one of [‘pixel’, ‘percent’]. Default=’pixel’
-
export_tags – exports the tags to a CSV file, it can be one of [True, False. Default=True
-
filter_by_tags – allows to filter results by tags, can be list or str
-
view¶
Opens browser on the annotation tool page for this annotation set
documentation
view()
view_stats¶
Opens browser on annotation set insights page
documentation
view_stats()