Video Project - Import annotation format

To import annotations to a Video Project, you need to import a JSON file of the annotations.

The annotations JSON in a Video Project contains three main fields: metadata, instances, and tags.

{
    "metadata": {},
    "instances": [],
    "tags": [],
}

🚧

The fields that are marked in bold in the descriptions are mandatory.

Metadata

{
    "metadata": {
        "name": "video_file_example_1",
        "width": 1920,
        "height": 1080,
        "url": "https://sa-public-files.s3.us-west-2.amazonaws.com/Video+project/video_file_example_1.mp4",
        "duration": 30526667,
        "error": null
}

Description:

  • "name": string - Video name as stated in the CSV file or generated by SDK.
  • "width": integer - The video’s width. The field is null if the video was not opened in the editor.
  • "height": integer - The video’s height. The field is null if the video was not opened in the editor.
  • “url”: string -The URL from the attached CSV file.
  • “duration”: integer - The video duration in microseconds.
  • "error": boolean - If it is true, the video is disapproved in the tool. If it is false, then the video is approved in the tool. The field is null if the video is neither approved nor disapproved.

Instances

Bounding Box

[{
            "meta": {
                "type": "bbox",
                "className": "Class 1",
                "pointLabels": {
                    "0": "Pointlabel_1"
                },
                "start": 0,
                "end": 23332991
            },
            "parameters": [
                {
                    "start": 0,
                    "end": 23332991,
                    "timestamps": [
                        {
                            "points": {
                                "x1": 515.51,
                                "y1": 216.7,
                                "x2": 866.79,
                                "y2": 678.58
                            },
                            "timestamp": 0,
                            "attributes": []
                        },
                        {
                            "points": {
                                "x1": 515.51,
                                "y1": 216.7,
                                "x2": 866.79,
                                "y2": 678.58
                            },
                            "timestamp": 10617971,
                            "attributes": [
                                {
                                    "name": "Attribute1",
                                    "groupName": "Group 1"
                                }
                            ]
                        },
                        {
                            "points": {
                                "x1": 1208.82,
                                "y1": 112.01,
                                "x2": 1560.1,
                                "y2": 573.89
                            },
                            "timestamp": 23332991,
                            "attributes": [
                                {
                                    "name": "Attribute1",
                                    "groupName": "Group 1"
                                }]
                        }]
                }]
        }
]

Description:

  • “meta”: objects
    • “type”: string - The dictionary is a bounding box.
    • “className”: string - Class name. If the instance has an undefined class, the key should not be in the JSON.
    • “pointLabels” : The keys are from “0” to “7” for the 8 vertices of the bounding box.
    • “start”: integer - The time that marks the beginning of an instance. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of an instance. The timestamp is in microseconds.
  • “parameters”: array
    • “start”: integer - The time that marks the beginning of an instance. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of an instance. The timestamp is in microseconds.
    • “timestamps”: array - Shows information about an instance at specific timestamps (start, end, edit).
      • “timestamp”: integer - Timestamp that marks the change of the instance. The timestamp in microseconds.
      • **“points”: objects - Points of the instance (bbox) in this location on the timeline. The list of floats is:
      • "x1, y1" for the left upper corner, and "x2, y2" for the right lower corner
        *
        “attributes”: array - List of attributes for the instance (bbox), in this location on a timeline.
        *
        "name" : string - Attribute name**
        • "groupName" : string- Attributes group name

Point

{
  "meta": {
    "type": "point",
    "className": "Animal",
    "start": 0,
    "end": 4250000
  },
  "parameters": [
    {
      "start": 0,
      "end": 4250000,
      "timestamps": [
        {
          "x": 6575.34,
          "y": 324.97,
          "timestamp": 3750000,
          "attributes": [
            {
              "name": "Flying",
              "groupName": "Motion"
            }
          ]
        },
        {
          "x": 298.46,
          "y": 23.76,
          "timestamp": 4250000,
          "attributes": [
            {
              "name": "Standing",
              "groupName": "Motion"
            },
            {
              "name": "Flying",
              "groupName": "Motion"
            }
          ]
        }
      ]
    }
  ]
}

Description:

  • “meta”: objects
    • “type”: string - The dictionary is a point.
    • “className”: string - Class name. If the instance has an undefined class, the key should not be in the JSON.
    • “start”: integer - The time that marks the beginning of an instance. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of an instance. The timestamp is in microseconds.
  • “parameters”: array
    • “start”: integer - The time that marks the beginning of an instance. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of an instance. The timestamp is in microseconds.
    • “timestamps”: array - Shows information about an instance at specific timestamps (start, end, edit).
      • “x”: integer - The x-coordinate of the instance.
      • “y”: integer - The y-coordinate of the instance.
      • “timestamp”: integer - Timestamp that marks the change of the instance. The timestamp in microseconds.
      • “attributes”: array - List of attributes for the instance (point), in this location on a timeline.
        • "name" : string - Attribute name
        • "groupName" : string- Attributes group name

Event

[
         {
            "meta": {
                "type": "event",
                "className": "Car",
                "start": 0,
                "end": 11546512},
            "parameters": [
                {
                    "start": 0,
                    "end": 11546512,
                    "timestamps": [
                        {
                            "timestamp": 0,
                            "attributes": [
                                {
                                    "name": "Yellow",
                                    "groupName": "Color"
                                }
                            ]
                        },
                        {
                            "timestamp": 11546512,
                            "attributes": [
                                {
                                    "name": "Yellow",
                                    "groupName": "Color"
                                }
                            ]
                        }]
                  }]
         }
]

Description:

  • “meta”: objects
    • “type”: The dictionary is an event.
    • “className”: string - Class name. If the event has an undefined class, the key should not be in the JSON.
    • “start”: integer - The time that marks the beginning of the event. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of the event. The timestamp is in microseconds.
  • “parameters”: array
    • “start”: integer - The time that marks the beginning of the event. The timestamp is in microseconds.
    • “end”: integer - The time that marks the end of the event. The timestamp is in microseconds.
    • “timestamps”: array - Shows information about the event at specific timestamps (start, end, edit).
      • “timestamp”: integer - Timestamp that marks the change of the event. The timestamp in microseconds.
      • “attributes”: array of objects - List of attributes for the event in this location on a timeline.
        • "name": string - Attribute name (must be in “classes.json”)
        • "groupName" : string - Attributes group name (must be in “classes.json”)

Tags

[
        "Tag3",
        "Tag2",
        "Tag1"
]

Description:

  • "Tag" - string: List of tag names added to the video.

Did this page help you?