Annotations

Get annotations

To get annotations from a project's root:

annotations = sa.get_annotations(project = "Project Name")

To get annotations from a list of items:

annotations = sa.get_annotations(project = "Project Name",
                                 items = ["item1.png", "item2.png", "item3.png"])

This function returns a list of annotations.

To get annotations per frame:

frame_annotations = sa.get_annotations_per_frame(project = "Project Name",
                                                 video ="video.mp4", fps = 30)

If you don't set a value to the fps, the value will be set for 1.

This function returns a list of the annotations per frame.

[
    {
        "frame": 1,
        "annotations": []
    },
    {
        "frame": 2,
        "annotations": []
    },
]

Description:

  • “frame”: integer - The frame number.
  • “annotations”: array - The list of annotations in the frame.

Delete image annotations

To delete all the annotations in a project:

sa.delete_annotations(project = "Project Name")

To delete all the annotations in a list of images:

sa.delete_annotations(project = "Project Name", image_names = ["image1.png", "image2.png"])

🚧

When you delete all the annotations, the items will have the Not Started annotation status.


Did this page help you?