---
updatedAt: 2026-07-16T15:55:35.000Z
agentTools:
  projectIndex: https://documentation.picsellia.com/llms.txt
---

# Annotation

#

# *Properties*

* `asset_id` UUID of the [Asset](asset) holding this [Annotation](annotation)

* `dataset_version_id` UUID of [DatasetVersion](datasetversion) holding this [Annotation](annotation)

* `duration` Duration time of this [Annotation](annotation)

* `status` Status of this [Annotation](annotation)

* `attributes` Attributes of this [Annotation](annotation)

***

# *Methods*

## update

```python
update(
   worker: (Worker|None) = None, duration: (float|int|None) = None,
   status: (AnnotationStatus|str|None) = None
)
```

**Description**

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

Worker parameter is deprecated and cannot be used anymore. It will be removed in 6.27

**Examples**

```python
one_annotation.update(status=AnnotationStatus.ACCEPTED)
```

**Arguments**

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

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

***

## delete

```python
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**

```python
one_annotation.delete()
```

***

## overwrite

```python
overwrite(
   rectangles: (list[tuple[int, int, int, int, Label]]|None) = None,
   polygons: (list[tuple[list[list[int]], Label]]|None) = None,
   classifications: (list[Label]|None) = None, lines: (list[tuple[list[list[int]],
   Label]]|None) = None, points: (list[tuple[list[int], Label]]|None) = None,
   duration: (float|int) = 0.0, masks: (list[tuple[str, Label]]|None) = None
)
```

**Description**

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

This method can be called on asset that are not synced in a campaign.

:warning: **DANGER ZONE**: Be very careful here!

**Examples**

```python
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* (float or int, optional) : Duration of this annotation. Defaults to 0.0.

* *masks* (list\[tuple\[str, Label]], optional) : List of masks to overwrite. Defaults to None.

***

## list\_rectangles

```python
list_rectangles()
```

**Description**

Retrieve all rectangles of this annotation

**Examples**

```python
rects = one_annotation.list_rectangles()
```

**Returns**

List of [Rectangle](rectangle) objects.

***

## create\_rectangle

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

**Description**

Create a rectangle into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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) : Label of the rectangle.

**Returns**

A [Rectangle](rectangle) object.

***

## create\_multiple\_rectangles

```python
create_multiple_rectangles(
   rectangles: list[tuple[int, int, int, int, Label]]
)
```

**Description**

Create some rectangles into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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](rectangle) objects.

***

## list\_polygons

```python
list_polygons()
```

**Description**

Retrieve all polygons of this annotation

**Examples**

```python
polys = one_annotation.list_polygons()
```

**Returns**

List of [Polygon](polygon) objects.

***

## create\_polygon

```python
create_polygon(
   coords: list[list[int]], label: Label
)
```

**Description**

Create a polygon into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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) : Label of the polygon.

**Returns**

A [Polygon](polygon) object.

***

## create\_multiple\_polygons

```python
create_multiple_polygons(
   polygons: list[tuple[list[list[int]], Label]]
)
```

**Description**

Create some polygons into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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](polygon) objects.

***

## list\_masks

```python
list_masks()
```

**Description**

Retrieve all masks of this annotation

**Examples**

```python
masks = annotation.list_masks()
```

**Returns**

List of (Mask) objects.

***

## create\_mask

```python
create_mask(
   mask: str, label: Label
)
```

**Description**

Create a mask into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
poly = annotation.create_mask("lba_1<_^12N2O001O1O000000O2O1KdXkf1", label_car)
```

**Arguments**

* *mask* (str) : Mask data.

* *label* [Label](label) : Label of the mask.

**Returns**

A (Mask) object.

***

## create\_multiple\_masks

```python
create_multiple_masks(
   masks: list[tuple[str, Label]]
)
```

**Description**

Create some masks into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
masks = one_annotation.create_multiple_masks([("lba_1<_^12N2O001O1O000000O2O1KdXkf1", label_car), ("dk^_15f^11N3N2N3N1O1O1O000000O2L4KWRkf1", label_person)])
```

**Arguments**

* *masks* (list\[tuple\[str, Label]]) : List of masks to create.

**Returns**

List of (Mask) objects.

***

## list\_lines

```python
list_lines()
```

**Description**

Retrieve all lines of this annotation

**Examples**

```python
lines = one_annotation.list_lines()
```

**Returns**

List of [Line](line) objects.

***

## create\_line

```python
create_line(
   coords: list[list[int]], label: Label
)
```

**Description**

Create a line into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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) : Label of the line.

**Returns**

A [Line](line) object.

***

## create\_multiple\_lines

```python
create_multiple_lines(
   lines: list[tuple[list[list[int]], Label]]
)
```

**Description**

Create some lines into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
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](line) objects.

***

## list\_points

```python
list_points()
```

**Description**

Retrieve all points of this annotation

**Examples**

```python
points = one_annotation.list_points()
```

**Returns**

List of [Point](point) objects.

***

## create\_point

```python
create_point(
   coords: list[int], label: Label
)
```

**Description**

Create a point into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

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

**Arguments**

* *coords* (list\[int]) : List of coordinates of the point.

* *label* [Label](label) : Label of the point.

**Returns**

A [Point](point) object.

***

## create\_multiple\_points

```python
create_multiple_points(
   points: list[tuple[list[int], Label]]
)
```

**Description**

Create some points into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

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

**Arguments**

* *points* (list\[tuple\[list\[int], Label]]) : List of points to create.

**Returns**

List of [Point](point) objects.

***

## list\_classifications

```python
list_classifications()
```

**Description**

Retrieve all classifications of this annotation

**Examples**

```python
classifications = one_annotation.list_classifications()
```

**Returns**

List of [Classification](classification) objects.

***

## create\_classification

```python
create_classification(
   label: Label
)
```

**Description**

Create a classification into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

```python
classifications = one_annotation.create_classification(label_car)
```

**Arguments**

* *label* [Label](label) : Label of the classification.

**Returns**

A [Classification](classification) object.

***

## create\_multiple\_classifications

```python
create_multiple_classifications(
   classifications: list[Label]
)
```

**Description**

Create some classifications into this annotation.

This method can be called on asset that are not synced in a campaign.

**Examples**

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

**Arguments**

* *classifications* (list\[Label]) : List of classifications to create.

**Returns**

List of [Classification](classification) objects.

***