Skip to content

Video Annotation

Annotate video in Potato with temporal segments, frame classification, keyframes, and object tracking, using frame-by-frame navigation along the timeline.

Potato supports video annotation across temporal segmentation, frame classification, keyframe marking, and object tracking.

Video player above the segment timeline, with three speaker segments on the timeline and in the Annotations listSpeaker turns marked as segments on the timeline

Annotation Modes

The mode you pick decides what the annotator produces and which controls appear, so choose it from the unit of analysis your study needs.

ModeDescriptionUse Case
segmentMark temporal rangesScene detection, speaker turns
frameClassify individual framesFrame-level labeling
keyframeMark important momentsHighlight detection
trackingTrack objects across framesObject tracking
combinedAll modes in one interfaceComplex annotation tasks

Basic Configuration

A minimal scheme names the labels and leaves every display option at its default, which puts the annotator on the segment timeline with zoom, speed control, and frame stepping already available:

yaml
annotation_schemes:
  - name: "video_segments"
    description: "Mark segments where the speaker changes"
    annotation_type: "video_annotation"
    labels:
      - name: "Speaker A"
        color: "#FF6B6B"
      - name: "Speaker B"
        color: "#4ECDC4"

Configuration Options

FieldTypeDefaultDescription
namestringRequiredUnique identifier for the annotation
descriptionstringRequiredInstructions shown to annotators
annotation_typestringRequiredMust be "video_annotation"
labelslistRequiredAvailable annotation labels
modestring"segment"Annotation mode
min_segmentsinteger0Minimum required annotations
max_segmentsintegernullMaximum allowed annotations
timeline_heightinteger70Timeline height in pixels
overview_heightinteger40Overview bar height in pixels
zoom_enabledbooleantrueEnable timeline zoom
playback_rate_controlbooleantrueShow playback speed selector
frame_steppingbooleantrueEnable frame-by-frame navigation
show_timecodebooleantrueDisplay frame number and time
video_fpsinteger30Video frame rate for calculations
source_fieldstring""Display field this schema annotates, when the item shows more than one video
point_marksbooleanfalsePlace frame labels and keyframes as points by clicking the video, in frame, keyframe, and combined mode (New in v2.15.0, see Points on Frames)
point_fade_framesinteger5Frames on either side of the point's own frame on which the point stays visible, drawn hollow
tracking_optionsmappinginterpolation, auto_advance_frames, and tools (bbox, point, or both) for tracking modes
relationslistRelations between two tracks over a frame range, in tracking and combined mode (New in v2.15.0, see Relations Between Tracks)

Label Configuration

Labels can be simple strings or detailed objects with colors and keyboard shortcuts. A key_value binds the label to a key, which matters most in segment work where the annotator's hands stay on playback controls:

yaml
labels:
  - name: "intro"
    color: "#4ECDC4"
    key_value: "1"
  - name: "content"
    color: "#3B82F6"
    key_value: "2"
  - name: "outro"
    color: "#8B5CF6"
    key_value: "3"

Examples by Mode

Segment Mode (Default)

Mark temporal ranges with start and end times. Zoom and playback speed are the two controls that decide how precisely an annotator can place a boundary, so scene work leaves both on:

yaml
annotation_schemes:
  - name: "scene_detection"
    description: "Mark each scene in the video"
    annotation_type: "video_annotation"
    mode: "segment"
    labels:
      - name: "indoor"
        color: "#3B82F6"
        key_value: "1"
      - name: "outdoor"
        color: "#22C55E"
        key_value: "2"
      - name: "transition"
        color: "#F59E0B"
        key_value: "3"
    zoom_enabled: true
    playback_rate_control: true

Frame Mode

Classify individual frames. Frame stepping and the timecode readout let the annotator land on one frame and record which frame they judged, which is what makes the labels reproducible:

yaml
annotation_schemes:
  - name: "frame_quality"
    description: "Classify each frame's quality"
    annotation_type: "video_annotation"
    mode: "frame"
    labels:
      - name: "good"
        color: "#22C55E"
      - name: "blurry"
        color: "#F59E0B"
      - name: "occluded"
        color: "#EF4444"
    frame_stepping: true
    show_timecode: true

Keyframe Mode

Mark important moments. A keyframe is a single point rather than a range, so frame stepping carries the accuracy of the whole task:

yaml
annotation_schemes:
  - name: "highlights"
    description: "Mark key moments in the video"
    annotation_type: "video_annotation"
    mode: "keyframe"
    labels:
      - name: "goal"
        color: "#22C55E"
      - name: "foul"
        color: "#EF4444"
      - name: "highlight"
        color: "#F59E0B"
    frame_stepping: true

Tracking Mode

Track objects across frames with bounding boxes. Set video_fps to the frame rate of your own files, because Potato converts times to frame numbers with this value and a mismatch shifts every box:

yaml
annotation_schemes:
  - name: "object_tracking"
    description: "Track the ball throughout the video"
    annotation_type: "video_annotation"
    mode: "tracking"
    labels:
      - name: "ball"
        color: "#3B82F6"
      - name: "player"
        color: "#22C55E"
    frame_stepping: true
    video_fps: 30

Combined Mode

Combined mode puts segments, frame labels, keyframes, and tracking in one interface. It asks the most of an annotator per video, so use it when the same pass has to produce several kinds of annotation:

yaml
annotation_schemes:
  - name: "full_pass"
    description: "Full video annotation"
    annotation_type: "video_annotation"
    mode: "combined"
    labels:
      - name: "action"
        color: "#3B82F6"
      - name: "dialogue"
        color: "#22C55E"
      - name: "transition"
        color: "#F59E0B"
    zoom_enabled: true
    playback_rate_control: true
    frame_stepping: true
    show_timecode: true

Video Display

For video playback without annotation (e.g., to accompany other annotation types), use the video type. It renders a player and collects nothing, so the annotator watches the clip and answers whatever other schemes the task defines:

yaml
annotation_schemes:
  - name: "video_player"
    description: "Watch the video clip"
    annotation_type: "video"
    video_path: "{{video_url}}"
    controls: true
    autoplay: false
    loop: false
    muted: false

Subtitles and Captions

If the video has captions, you can annotate those instead of, or alongside, the video timeline. Potato reads WebVTT, SubRip, TTML/DFXP, SubStation Alpha, and YouTube's json3 and srv1/srv2/srv3 formats, detecting each from the file contents rather than the extension.

bash
yt-dlp --write-auto-subs --sub-langs en --sub-format vtt --skip-download <URL>
json
{"id": "talk_01", "conversation": {"audio": "media/talk_01.mp3",
                                   "transcript": "captions/talk_01.vtt"}}

Note: Auto-generated captions have no punctuation and no speaker labels, and their cue boundaries fall where the caption window filled up rather than where a sentence ended. Do not build a sentence-level scheme over them. See Annotating YouTube Subtitles for what to do instead.

The full format list is in Transcript Formats.

Keyboard Shortcuts

Potato generates the shortcut list from the scheme, so the frame, segment, keyframe, and classification keys appear only in the modes that use them.

KeyAction
SpacePlay/pause
← / →Seek 5 seconds
, / .Previous/next frame (when frame_stepping is on)
[Set segment start (segment and combined modes)
]Set segment end (segment and combined modes)
EnterCreate segment (segment and combined modes)
KMark keyframe (keyframe and combined modes)
CClassify current frame (frame and combined modes)
DelDelete selected
+ / -Zoom in/out
0Fit to view

Each label with a key_value adds its own key, so 1, 2, and 3 select labels in the examples above.

Data Format

Input Data

Your data file should include video paths or URLs:

json
[
  {
    "id": "video_1",
    "video_url": "https://example.com/videos/sample1.mp4",
    "description": "Meeting recording - identify speakers"
  },
  {
    "id": "video_2",
    "video_url": "/data/videos/sample2.mp4",
    "description": "Activity video - label actions"
  }
]

Output Format

Output varies by mode:

Segment Mode:

json
{
  "id": "video_1",
  "annotations": {
    "scene_detection": [
      {
        "start": 0.0,
        "end": 5.2,
        "start_frame": 0,
        "end_frame": 156,
        "label": "indoor"
      }
    ]
  }
}

Frame Mode:

json
{
  "id": "video_1",
  "annotations": {
    "frame_quality": [
      {
        "frame": 120,
        "time": 4.0,
        "label": "good"
      }
    ]
  }
}

Keyframe Mode:

json
{
  "id": "video_1",
  "annotations": {
    "highlights": [
      {
        "frame": 450,
        "time": 15.0,
        "label": "goal",
        "note": "First goal of the match"
      }
    ]
  }
}

Tracking Mode:

json
{
  "id": "video_1",
  "annotations": {
    "object_tracking": [
      {
        "id": "track_1",
        "label": "ball",
        "frames": [
          {"frame": 0, "bbox": {"x": 100, "y": 200, "w": 30, "h": 30}},
          {"frame": 1, "bbox": {"x": 105, "y": 198, "w": 30, "h": 30}}
        ]
      }
    ]
  }
}

Supported Video Formats

  • MP4 (recommended)
  • WebM
  • MOV
  • OGG

Video Object Tracking with Keyframe Interpolation

New in v2.2.0

Tracking mode interpolates between keyframes. An annotator marks an object's position on a few frames and Potato fills in the frames between them, so a tracked object costs a handful of boxes rather than one box per frame. Set video_fps to the frame rate of the source file, since the interpolation is computed over frame numbers:

yaml
annotation_schemes:
  - name: "tracking"
    description: "Track objects with keyframe interpolation"
    annotation_type: "video_annotation"
    mode: "tracking"
    labels:
      - name: "person"
        color: "#3B82F6"
      - name: "vehicle"
        color: "#22C55E"
    frame_stepping: true
    video_fps: 30

Workflow

  1. Navigate to a keyframe and draw a bounding box around the object
  2. Skip ahead several frames and reposition the bounding box
  3. The system automatically interpolates positions for intermediate frames
  4. Review and adjust interpolated positions as needed

The full set of valid annotation modes is: segment, frame, keyframe, tracking, and combined.

Points on Frames

New in v2.15.0

Some tasks record where on a frame something appears as well as when, such as the blur at a jawline that a deepfake reviewer clicks on frame 212. point_marks: true turns each frame label or keyframe into a point placed by clicking the picture, in frame, keyframe, and combined mode:

yaml
annotation_schemes:
  - name: "artifacts"
    description: "Click each visible manipulation artifact"
    annotation_type: "video_annotation"
    mode: "frame"
    point_marks: true
    point_fade_frames: 5
    labels:
      - name: "blur"
        color: "#FF6B6B"
      - name: "warping"
        color: "#4ECDC4"

In frame mode, pick a label and click the video to put a point on the current frame, and one frame can have several points. The same click marks a keyframe at the clicked spot in keyframe mode. Because a click on the video draws a track in combined mode, press C for a frame point or K for a keyframe point there before clicking. A point is drawn filled on the point's own frame and hollow on the point_fade_frames frames on either side. Potato stores each point's x and y as fractions of the picture from the picture's top-left corner, and resizing the window leaves the stored values unchanged.

Point Tracks

To follow a point across frames, add point to tracking_options.tools in tracking or combined mode:

yaml
annotation_schemes:
  - name: "gaze"
    description: "Follow the gaze target"
    annotation_type: "video_annotation"
    mode: "tracking"
    labels:
      - name: "target"
        color: "#45B7D1"
    tracking_options:
      tools: [bbox, point]
      interpolation: linear

With both tools listed, a Box / Point switch appears next to + Track, and tools: [point] makes every track a point track. Create a track, click the object, step forward, and click the object again. Between keyframes, the point moves in a straight line. A box track refuses points and a point track refuses boxes. Track forward (SAM 2) starts from a box and does not apply to point tracks.

Relations Between Tracks

New in v2.15.0

A scene graph records which object acts on which other object and over which frames, such as a grasper retracting the gallbladder from frame 120 to frame 310. In tracking or combined mode, a scheme lists the allowed relations under relations:

yaml
annotation_schemes:
  - name: "scene"
    description: "Track each tool and structure, then relate them"
    annotation_type: "video_annotation"
    mode: "tracking"
    labels: [grasper, hook, gallbladder, cystic_duct]
    relations:
      - name: retracts
        subject_labels: [grasper]
        object_labels: [gallbladder]
      - name: dissects
        subject_labels: [hook]

subject_labels and object_labels limit the tracks each relation can join, and a side left out accepts a track with any label. In the Relations between tracks panel under the video, the annotator picks the subject track, the relation, the object track, and the frame range. Now sets either end of the range to the frame on screen. Each relation is saved with the tracks as {subject, predicate, object, start_frame, end_frame}, where subject and object are track ids. The server refuses a relation the scheme does not declare, a track the answer does not have, the same track on both sides, a track whose label the relation does not allow, and a start frame after the end frame. Deleting a track deletes the relations that name the track.

Agreement on Points and Relations

The agreement report at /admin/iaa scores relations under the scheme's relations entry. Potato first matches each annotator's tracks to the other annotators' tracks by position over time, with temporal overlap times box intersection over union (IoU) at 0.5 or more. A relation is then compared by the objects the relation joins instead of by track ids. Two relations match when the subject, the relation, and the object match and the frame ranges overlap at a temporal IoU of 0.5 or more. The report gives four measures:

MeasureWhat it is
relation_f1Mean over annotator pairs of 2 × matched relations / both annotators' relations
relation_f1_ignoring_timeThe same score with any two frame ranges counted as matching
mean_matched_temporal_iouMean frame-range overlap of the relations matched with time ignored
per_predicateThe F1 for each relation name, pooled over annotator pairs

A gap between relation_f1 and relation_f1_ignoring_time measures disagreement about when a relation holds. Because a point has no area, the report gives a scheme with points a points group in place of an overlap measure. The group gives the mean and median distance between paired points in fractions of the picture, where 0 means the same spot.

Exporting Points and Relations

The video_points export writes every frame point, keyframe point, and point-track keyframe to video_points.json and video_points.csv:

bash
python -m potato.export --config config.yaml --format video_points --output ./points

Each row has one point, with instance_id, user_id, schema, source (frame, keyframe, or track), mark_id, frame, time, x, y, label, keyframe, and media. --option interpolate=true adds a track row on every frame between a track's first and last keyframe, with keyframe set to false on each added row. The mot export contains boxes only and leaves points out.

The scene_graph export writes the relations of every scheme that declares relations:

bash
python -m potato.export --config config.yaml --format scene_graph --output ./graphs

scene_graphs.json has one entry per item, annotator, and scheme, with the related tracks as objects and the relations beside the objects. relations.csv has one row per relation. --option per_frame=true also writes scene_graph_frames.jsonl, with one line per frame listing the relations in force as [subject, predicate, object] triples. Track ids belong to each annotator, and the same grasper therefore has a different id under each annotator.

Audio Description

New in v2.15.0

Audio description is narration written into the pauses between lines of dialogue, and each description has to be short enough to say within the pause. Two options support the task in segment and combined mode. speech_activity_key names an item field that contains the speech regions as [[start, end], ...] in seconds, and description_fit compares how long a segment's description takes to say with how long the segment lasts:

yaml
annotation_schemes:
  - annotation_type: video_annotation
    name: description
    description: "Describe what happens in each gap between lines of dialogue"
    mode: segment
    labels:
      - name: AD
    label_requirement:
      required: true
    speech_activity_key: speech_activity
    segment_schemes:
      - annotation_type: text
        name: text
        description: "Description"
    description_fit:
      scheme: text
      words_per_second: 2.5
      block_on_overflow: true

Potato shades the speech regions as gray bands on the timeline, and the bands cannot be selected or moved. A double-click in a gap between bands makes a segment that fills the gap and selects the new segment, ready for the description. The bands need the timeline, and the timeline needs an audio track that the browser can decode.

description_fit.scheme names the text question in segment_schemes that collects the description. For the selected segment, the panel shows the word count, the time the words take to say at words_per_second (2.5 by default, about 150 words a minute), and the segment's length, and turns red when the description is too long. Each segment in the annotation list shows a badge such as 4.8/3.0 s (too long). By default, the badge is a warning only. With block_on_overflow: true, Next stays blocked until every description fits, and Potato refuses block_on_overflow on a scheme without label_requirement: {required: true}.

potato transcripts vad fills the speech field without transcribing anything. The command runs a voice-activity model over each item's audio or video and writes the regions into the data file, under speech_activity unless --field names another field:

bash
pip install 'potato-annotation[transcribe]'
potato transcripts vad data/films.json --media-dir ./media

By default, the command rewrites the data file in place, and -o writes the result to a new file. A hotlinked clip or other media given as an http(s) URL is downloaded to a temporary file, analyzed, and deleted, and the item keeps the URL. --no-fetch-remote skips such items, and --max-download-mb (500 by default) caps the size of each download. Check the regions before annotators rely on the regions. The model scores how much a sound resembles a voice, and singing or an animal call can therefore come through as speech.

Technical Notes

  • Uses Peaks.js for timeline visualization
  • Standard HTML5 video elements (no additional server dependencies)
  • Timeline supports drag-to-select for segment creation

Best Practices

  1. Use compressed videos - Large files slow down loading
  2. Set appropriate FPS - Match video_fps to your actual video frame rate
  3. Keep frame stepping on - Frame-level work depends on it
  4. Use playback rate control - Slow motion helps with detailed work
  5. Provide clear segment definitions - Define what constitutes segment boundaries
  6. Use distinct colors - Make labels visually distinguishable
  7. Consider timeline height - Increase for complex segmentation tasks