Annotation

An annotation refers to a single annotation object of a given image.

Use an Annotation object if you need low level control on annotations.

class remo.Annotation

Represents a single annotation object. This can be:

  • list of classes only: to assign classes to an image for image classification tasks

  • bounding box and list of classes: to create a bounding box annotation object and assign it a list of classes

  • segment and list of classes: to create a polygon annotation object and assign it a list of classes

documentation
class remo.Annotation(img_filename: str = None, classes=None, object=None)
  • Parameters

    • img_filename – file name of the image the annotation refers to

    • classes – class or list of classes to add to the whole image or the object

    • object – the specific annotation object to add


Examples

to create a bounding box:

annotation = Annotation(‘image.png’, ‘Dog’)
annotation.bbox = [1, 23, 3, 2]

to create a polygon:

annotation = Annotation(‘image.png’, ‘Dog’)
annotation.segment = [1, 23, 3, 2, 1, 2, 1, 2]

class Bbox

Represents coordinates of a bounding box annotation. Used in object detection.

documentation
class Bbox(xmin: int, ymin: int, xmax: int, ymax: int)
  • Parameters

    • xmin – X min

    • ymin – Y min

    • xmax – X max

    • ymax – Y max


task

documentation
task( = 'object_detection')

class Segment

Represents coordinates of a segment annotation. Used in instance segmentation.

documentation
class Segment(points: List[int])
  • Parameters

    points – list of segment coordinates [x0, y0, x1, y1, ..., xN, yN]


task

documentation
task( = 'instance_segmentation')

property bbox

documentation
property bbox()

property segment

documentation
property segment()

property task

documentation
property task()