Segments

Segment

A segment represents a continuous section where an object is visible. If an instance disappears then the segment ends. If it re-appears, a new segment is created.

4254

Label in video editor containing 3 segments (bounding box, point, polyline)

Keyframe

Keyframes identify the location of an instance. Between keyframes, the location of the instance is interpolated.

Import

Python SDK

📘

Coming soon

NDJSON

Definition

ParameterAsset typeRequiredDescription
SegmentsVideoYesA list of segment containing at least a start and end keyframe
KeyframesVideoYesA list of keyframes defining a single, continuous segment
A supported annotation
- Bounding box
VideoYes
Each segment is a unique annotation instance

schemaId: <featureSchemaId>
dataRow:
    id: <dataRowId>
Instance:
    [Segments]:
        [KeyFrames]:
            frame:
            annotation

Format

Below is an example of 2 segments. The first segment starts at frame 1 and ends at frame 20. The second segment starts at frame 27 and ends at the end of the video.

segments = [{
    "keyframes": [{
        "frame": 1,
        "bbox": {
            "top": 80,
            "left": 80,
            "height": 80,
            "width": 80
        }
    }, {
        "frame": 20,
        "bbox": {
            "top": 125,
            "left": 125,
            "height": 200,
            "width": 300
        }
    }]
}, {
    "keyframes": [{
        "frame": 27,
        "bbox": {
            "top": 80,
            "left": 50,
            "height": 80,
            "width": 50
        }
    }]
}]