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

Exports annotations in a given format

documentation
export_annotations(annotation_format: str = 'json', export_coordinates: str = 'pixel', full_path: bool = True, export_tags: bool = True)
  • Parameters

    • annotation_format – choose format from this list [‘json’, ‘coco’, ‘csv’]

    • full_path – uses full image path (e.g. local path), it can be one of [True, False], 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

  • Returns

    annotation file content


export_annotations_to_file

Exports annotations in given format and save to output file

documentation
export_annotations_to_file(output_file: str, annotation_format: str = 'json', export_coordinates: str = 'pixel', full_path: bool = True, export_tags: bool = True)
  • Parameters

    • output_file – output file to save

    • annotation_format – can be one of [‘json’, ‘coco’, ‘csv’], default=’json’

    • full_path – uses full image path (e.g. local path), it can be one of [True, False], 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


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()