Annotation

Properties


Methods

update

update(
   worker: Optional[Worker] = None, duration: Union[float, int, None] = None,
   status: Union[AnnotationStatus, str, None] = None
)

Description

Update this annotation with a new worker, a new duration or a new status.

Examples

one_annotation.update(status=AnnotationStatus.ACCEPTED)

Arguments

  • worker (Worker, optional) : Worker of this annotation. Defaults to None.

  • duration (float, optional) : Duration of this annotation. Defaults to None.

  • status (AnnotationStatus, optional) : Status of this annotation. Defaults to None.


delete

delete()

Description

Delete this annotation from the platform.
All annotations shapes will be deleted!
This is a very dangerous move.

:warning: DANGER ZONE: Be very careful here!

Examples

one_annotation.delete()

overwrite

overwrite(
   rectangles: Optional[List[Tuple[int, int, int, int, Label]]] = None,
   polygons: Optional[List[Tuple[List[List[int]], Label]]] = None,
   classifications: Optional[List[Label]] = None,
   lines: Optional[List[Tuple[List[List[int]], Label]]] = None,
   points: Optional[List[Tuple[List[int], int, Label]]] = None,
   duration: Union[float, int] = 0.0
)

Description

Overwrite content of this annotation with a new duration and new shapes

:warning: DANGER ZONE: Be very careful here!

Examples

one_annotation.overwrite(rectangles=[(10, 20, 30, 40, label_cat), (50, 60, 20, 30, label_dog)])

Arguments

  • rectangles (List[Tuple[int, int, int, int, Label]], optional) : List of rectangles to overwrite. Defaults to None.

  • polygons (List[Tuple[List[List[int]], Label]], optional) : List of polygons to overwrite. Defaults to None.

  • classifications (List[Label], optional) : List of classifications to overwrite. Defaults to None.

  • lines (List[Tuple[List[List[int]], Label]], optional) : List of lines to overwrite. Defaults to None.

  • points (List[Tuple[List[int], int, Label]], optional) : List of points to overwrite. Defaults to None.

  • duration (Union[float, int], optional) : Duration of this annotation. Defaults to 0.0.


list_rectangles

list_rectangles()

Description

Retrieve all rectangles of this annotation

Examples

rects = one_annotation.list_rectangles()

Returns

List of Rectangle objects.


create_rectangle

create_rectangle(
   x: int, y: int, w: int, h: int, label: Label
)

Description

Create a rectangle into this annotation.

Examples

rect = one_annotation.create_rectangle(420, 69, 100, 10, label_car)

Arguments

  • x (int) : x coordinate of the rectangle.

  • y (int) : y coordinate of the rectangle.

  • w (int) : width of the rectangle.

  • h (int) : height of the rectangle.

  • label Label : Label of the rectangle.

Returns

A Rectangle object.


create_multiple_rectangles

create_multiple_rectangles(
   rectangles: List[Tuple[int, int, int, int, Label]]
)

Description

Create some rectangles into this annotation.

Examples

rects = one_annotation.create_multiple_rectangles([(420, 69, 100, 10, label_car), (123, 456, 20, 20, label_person)])

Arguments

  • rectangles (List[Tuple[int, int, int, int, Label]]) : List of rectangles to create.

Returns

List of Rectangle objects.


list_polygons

list_polygons()

Description

Retrieve all polygons of this annotation

Examples

polys = one_annotation.list_polygons()

Returns

List of Polygon objects.


create_polygon

create_polygon(
   coords: List[List[int]], label: Label
)

Description

Create a polygon into this annotation.

Examples

poly = one_annotation.create_polygon([[0, 0], [0, 1], [1, 1], [0, 0]], label_car)

Arguments

  • coords (List[List[int]]) : List of coordinates of the polygon.

  • label Label : Label of the polygon.

Returns

A Polygon object.


create_multiple_polygons

create_multiple_polygons(
   polygons: List[Tuple[List[List[int]], Label]]
)

Description

Create some polygons into this annotation.

Examples

polys = one_annotation.create_multiple_polygons([([[0, 0], [0, 1], [1, 1], [0, 0]] label_car), ([[0, 2], [0, 3], [1, 2], [0, 2]] label_person)])

Arguments

  • polygons (List[Tuple[List[List[int]], Label]]) : List of polygons to create.

Returns

List of Polygon objects.


list_lines

list_lines()

Description

Retrieve all lines of this annotation

Examples

lines = one_annotation.list_lines()

Returns

List of Line objects.


create_line

create_line(
   coords: List[List[int]], label: Label
)

Description

Create a line into this annotation.

Examples

line = one_annotation.create_line([[0, 0], [0, 1], [1, 1], [0, 0]], label_car)

Arguments

  • coords (List[List[int]]) : List of coordinates of the line.

  • label Label : Label of the line.

Returns

A Line object.


create_multiple_lines

create_multiple_lines(
   lines: List[Tuple[List[List[int]], Label]]
)

Description

Create some lines into this annotation.

Examples

lines = one_annotation.create_multiple_lines([([[0, 0], [0, 1], [1, 1]] label_car), ([[0, 2], [0, 3], [1, 2]] label_person)])

Arguments

  • lines (List[Tuple[List[List[int]], Label]]) : List of lines to create.

Returns

List of Line objects.


list_points

list_points()

Description

Retrieve all points of this annotation

Examples

points = one_annotation.list_points()

Returns

List of Point objects.


create_point

create_point(
   coords: List[int], order: int, label: Label
)

Description

Create a point into this annotation.

Examples

poly = one_annotation.create_point([0, 0], 1, label_car)

Arguments

  • coords (List[int]) : List of coordinates of the point.

  • order (int) : Order of the point.

  • label Label : Label of the point.

Returns

A Point object.


create_multiple_points

create_multiple_points(
   points: List[Tuple[List[int], int, Label]]
)

Description

Create some points into this annotation.

Examples

polys = one_annotation.create_multiple_points([([0, 0], label_car), ([0, 2], label_person)])

Arguments

  • points (List[Tuple[List[int], int, Label]]) : List of points to create.

Returns

List of Point objects.


list_classifications

list_classifications()

Description

Retrieve all classifications of this annotation

Examples

classifications = one_annotation.list_classifications()

Returns

List of Classification objects.


create_classification

create_classification(
   label: Label
)

Description

Create a classification into this annotation.

Examples

classifications = one_annotation.create_classification(label_car)

Arguments

  • label Label : Label of the classification.

Returns

A Classification object.


create_multiple_classifications

create_multiple_classifications(
   classifications: List[Label]
)

Description

Create some classifications into this annotation.

Examples

polys = one_annotation.create_multiple_classifications([label_car, label_person])

Arguments

  • classifications (List[Label]) : List of classifications to create.

Returns

List of Classification objects.