Skip to content
Tutorials3 min read

為目標檢測繪製邊界框

完整的邊界框標註設定指南,適用於計算機視覺任務,包括標籤顏色和驗證規則。

Potato Team

邊界框標註是訓練目標檢測模型的基礎。本教程涵蓋從基本設定到預標註和驗證規則等高階功能的全部內容。

基本邊界框設定

最簡配置

yaml
annotation_task_name: "Object Detection Annotation"
 
data_files:
  - "data/images.json"
 
annotation_schemes:
  - annotation_type: image_annotation
    name: objects
    description: "Draw boxes around all objects"
    tools:
      - bbox
    labels:
      - name: car
        color: "#FF6B6B"
      - name: person
        color: "#4ECDC4"
      - name: bicycle
        color: "#45B7D1"

工作流程

  1. 從工具欄選擇標籤
  2. 點選並拖動繪製框
  3. 調整角點以精確框選
  4. 根據需要新增更多框
  5. 完成後提交

詳細標籤配置

yaml
annotation_schemes:
  - annotation_type: image_annotation
    name: objects
    description: "Annotate all visible objects"
    tools:
      - bbox
    labels:
      - name: person
        color: "#FF6B6B"
        description: "Any human, partial or full"
        keyboard_shortcut: "p"
 
      - name: car
        color: "#4ECDC4"
        description: "Cars, trucks, SUVs"
        keyboard_shortcut: "c"
 
      - name: motorcycle
        color: "#45B7D1"
        description: "Motorcycles and scooters"
        keyboard_shortcut: "m"
 
      - name: bicycle
        color: "#96CEB4"
        description: "Bicycles of all types"
        keyboard_shortcut: "b"
 
      - name: traffic_light
        color: "#FFEAA7"
        description: "Traffic signals"
        keyboard_shortcut: "t"
 
      - name: stop_sign
        color: "#DDA0DD"
        description: "Stop signs"
        keyboard_shortcut: "s"

新增目標屬性

為每個框捕獲額外資訊:

yaml
annotation_schemes:
  - annotation_type: image_annotation
    name: objects
    tools:
      - bbox
    labels:
      - name: person
        color: "#FF6B6B"
        attributes:
          - name: occlusion
            type: radio
            options: [none, partial, heavy]
          - name: truncated
            type: checkbox
            description: "Object extends beyond image"
          - name: difficult
            type: checkbox
            description: "Hard to identify"

當標註者繪製框時,系統會提示他們填寫這些屬性。

驗證規則

通過驗證確保標註品質:

yaml
annotation_schemes:
  - annotation_type: image_annotation
    name: objects
    tools:
      - bbox
    labels: [...]
    min_annotations: 1

鍵盤快捷鍵

Potato 包含內建鍵盤快捷鍵以提高標註效率:

  • 數字鍵選擇標籤
  • Delete 鍵刪除選中的標註
  • 方向鍵在項目間導航

顯示選項

配置影像顯示設定:

yaml
image_display:
  width: 800
  height: 600

完整的生產配置

yaml
annotation_task_name: "Autonomous Driving - Object Detection"
 
data_files:
  - "data/driving_frames.json"
 
annotation_schemes:
  - annotation_type: image_annotation
    name: objects
    description: "Annotate all traffic participants and objects"
    tools:
      - bbox
    min_annotations: 1
    labels:
      - name: vehicle
        color: "#FF6B6B"
        keyboard_shortcut: "v"
        attributes:
          - name: type
            type: radio
            options: [car, truck, bus, motorcycle, bicycle]
          - name: occlusion
            type: radio
            options: [0%, 1-25%, 26-50%, 51-75%, 76-99%]
 
      - name: pedestrian
        color: "#4ECDC4"
        keyboard_shortcut: "p"
        attributes:
          - name: pose
            type: radio
            options: [standing, walking, sitting, lying]
          - name: age_group
            type: radio
            options: [child, adult, elderly]
 
      - name: cyclist
        color: "#45B7D1"
        keyboard_shortcut: "c"
 
      - name: traffic_sign
        color: "#FFEAA7"
        keyboard_shortcut: "t"
        attributes:
          - name: sign_type
            type: radio
            options: [stop, yield, speed_limit, warning, other]
 
      - name: traffic_light
        color: "#DDA0DD"
        keyboard_shortcut: "l"
        attributes:
          - name: state
            type: radio
            options: [red, yellow, green, off, unknown]

輸出格式

json
{
  "frame_id": "frame_0001",
  "frame_path": "/images/frame_0001.jpg",
  "image_dimensions": {"width": 1920, "height": 1080},
  "annotations": {
    "objects": [
      {
        "label": "vehicle",
        "bbox": [450, 380, 680, 520],
        "attributes": {
          "type": "car",
          "occlusion": "0%"
        }
      },
      {
        "label": "pedestrian",
        "bbox": [820, 400, 870, 550],
        "attributes": {
          "pose": "walking",
          "age_group": "adult"
        }
      }
    ]
  }
}

高品質邊界框技巧

  1. 緊湊的框:最小化框中的背景
  2. 一致的規則:清晰記錄邊緣情況
  3. 校準會議:團隊一起審查示例
  4. 跟蹤指標:監控框的數量和大小分佈

下一步


完整文件請參閱 影像標註