Skip to content
チュートリアル5分で読めます

フレーム単位のコントロールによるビデオアノテーション

精密なフレームナビゲーション、タイムスタンプマーカー、時間的イベントラベリングを備えたビデオアノテーションタスクの設定。

Potato Team

ビデオアノテーションは、行動認識、オブジェクトトラッキング、時間的イベント検出のための学習データ作成を可能にします。本チュートリアルでは、フレームナビゲーション、時間的セグメンテーション、効率的なビデオラベリングワークフローを紹介します。

ビデオアノテーション機能

Potatoはラベリングと分類タスクのためのビデオアノテーションをサポートしています:

  • ビデオ分類: ビデオクリップ全体にラベルを付ける
  • マルチラベルタグ付け: ビデオに複数のタグを適用
  • 時間的アノテーション: ビデオ内のイベントをマークする

基本的なビデオ設定

yaml
annotation_task_name: "Video Action Recognition"
task_dir: "."
 
data_files:
  - "data/videos.json"
 
item_properties:
  id_key: id
  text_key: video_url
 
output_annotation_dir: "annotation_output/"
export_annotation_format: "jsonl"
 
annotation_schemes:
  - annotation_type: video_annotation
    name: action
    description: "Mark each stretch of video where one action is happening"
    mode: segment
    labels:
      - name: walking
        color: "#4ECDC4"
        key_value: "1"
      - name: running
        color: "#FF6B6B"
        key_value: "2"
      - name: jumping
        color: "#45B7D1"
        key_value: "3"
      - name: sitting
        color: "#FFEAA7"
        key_value: "4"
 
user_config:
  allow_all_users: true

フレーム単位のナビゲーション

yaml
    min_segments: 1
    label_requirement:
      required: true

時間的セグメントアノテーション

開始時間と終了時間でイベントをマークします:

yaml
annotation_schemes:
  - annotation_type: video_annotation
    name: frame_label
    description: "Classify the current frame"
    mode: frame
    frame_stepping: true
    show_timecode: true
    video_fps: 30
    labels:
      - name: action
        color: "#FF6B6B"
        key_value: "1"
      - name: no_action
        color: "#9CA3AF"
        key_value: "2"

セグメントの作成

  1. イベントの開始位置にナビゲートする
  2. [を押すか「Mark Start」をクリックする
  3. イベントの終了位置にナビゲートする
  4. ]を押すか「Mark End」をクリックする
  5. イベントラベルを選択する
  6. すべてのイベントについて繰り返す

ビデオ分類

ラベルを使用してビデオコンテンツを分類します:

yaml
annotation_schemes:
  - annotation_type: video_annotation
    name: key_moments
    description: "Mark the moment each action begins, peaks, and ends"
    mode: keyframe
    labels:
      - name: action_start
        color: "#22C55E"
        key_value: "1"
      - name: action_peak
        color: "#EF4444"
        key_value: "2"
      - name: action_end
        color: "#3B82F6"
        key_value: "3"

ビデオごとの分類

標準的なアノテーションタイプでビデオを分類します:

yaml
annotation_schemes:
  - annotation_type: video_annotation
    name: plays
    description: "Mark each play and describe it"
    mode: segment
    labels:
      - name: attack
        color: "#EF4444"
      - name: defense
        color: "#3B82F6"
    segment_schemes:
      - annotation_type: radio
        name: outcome
        description: "How did this play end?"
        labels: ["scored", "turnover", "out of play"]

ラベル付きビデオ

カテゴリラベルでビデオをアノテーションします:

yaml
annotation_schemes:
  - annotation_type: multiselect
    name: clip_tags
    description: "Tags that apply to this clip as a whole"
    labels:
      - Highlight worthy
      - Good camera angle
      - Multiple players
      - Close-up
      - Wide shot
      - Slow motion available

完全なビデオアノテーション設定

yaml
annotation_task_name: "Sports Video Analysis"
task_dir: "."
 
data_files:
  - "data/sports_clips.json"
 
item_properties:
  id_key: id
  text_key: video_url
 
output_annotation_dir: "annotations/"
export_annotation_format: "jsonl"
 
annotation_instructions: |
  ## Event marking
 
  - Mark an event from the frame it **starts**, not from the frame it becomes obvious.
  - Include the full play sequence in the segment.
  - For a goal, run the segment from the shot to the ball crossing the line.
 
  ## Navigation
 
  - `Space` plays and pauses, `,` and `.` step one frame.
  - `[` and `]` set the segment boundaries, `Enter` creates the segment.
 
annotation_schemes:
  - annotation_type: video_annotation
    name: game_events
    description: "Mark every game event and its duration"
    mode: segment
    frame_stepping: true
    show_timecode: true
    playback_rate_control: true
    video_fps: 30
    min_segments: 1
    label_requirement:
      required: true
    labels:
      - name: goal
        color: "#22C55E"
        key_value: "1"
      - name: foul
        color: "#EF4444"
        key_value: "2"
      - name: corner_kick
        color: "#3B82F6"
        key_value: "3"
      - name: free_kick
        color: "#F59E0B"
        key_value: "4"
      - name: penalty
        color: "#EC4899"
        key_value: "5"
      - name: offside
        color: "#8B5CF6"
        key_value: "6"
 
  - annotation_type: multiselect
    name: clip_tags
    description: "Tags that apply to this clip as a whole"
    labels:
      - Highlight worthy
      - Good camera angle
      - Multiple players
      - Close-up
      - Wide shot
      - Slow motion available
 
user_config:
  allow_all_users: true

出力フォーマット

json
{
    "video_metadata": {
        "duration": 120.5,
        "fps": 30,
        "width": 1920,
        "height": 1080
    },
    "segments": [
        {
            "id": "segment_1",
            "start_time": 0.0,
            "end_time": 10.5,
            "start_frame": 0,
            "end_frame": 315,
            "label": "goal"
        }
    ],
    "frame_annotations": {
        "450": {
            "frame": 450,
            "time": 15.0,
            "label": "scene_change"
        }
    },
    "keyframes": [
        {
            "id": "kf_1",
            "frame": 900,
            "time": 30.0,
            "label": "important_moment",
            "note": "Key dialogue"
        }
    ],
    "tracking": {}
}

ビデオアノテーションのコツ

  1. 初回は概観を掴む: まず通常速度で視聴する
  2. 精度にはスローモーション: 正確なタイムスタンプには0.25倍速を使用
  3. キーボードショートカット: マウスより大幅に速い
  4. 休憩を取る: ビデオアノテーションは視覚的に負担が大きい
  5. 一貫した基準: 境界ケースを明確に文書化する

次のステップ


完全なドキュメントは画像アノテーション(ビデオセクション)をご覧ください。