VLM 資料格式 (VQA)

視覺-語言模型 (VLM) 的輸入與輸出格式

本文件說明 視覺-語言模型 (VLM, Vision-Language Model)輸入與輸出格式 的結構與要求。此格式用於管理與評估包含圖片 問題與答案 (Q&A) 的標註數據集。

架構

以下 JSON 範例展示了 VLM 格式的頂層組件:

spinner

範例

VLM JSON 文件的基本格式如下:

[
  {
    "id": "example_image",
    "image": "example_image.jpg",
    "conversations": [
      {
        "question_id": 1,
        "question": "Is there a bus in the image?",
        "answer": {
          "groundtruth": true,
          "model001": true
        }
      },
      {
        "question_id": 2,
        "question": "How many people are in the image?",
        "answer": {
          "groundtruth": 0,
          "model001": 3
        }
      },
      {
        "question_id": 3,
        "question": "What are the colors of the bus?",
        "answer": {
          "groundtruth": "red and white",
          "model001": "red and white"
        }
      },
      {
        "question_id": 4,
        "question": "What types of vehicles are in the image?",
        "answer": {
          "groundtruth": ["bus"],
          "model001": ["car"]
        }
      }
    ]
  },
  {
    "id": "example_image2",
    "image": "example_image2.jpg",
    "conversations": []
  }
]

VLM {}

Name
Definition
Type
Required

id

圖片的唯一識別碼。

string

true

images

圖片檔名 (Image File Name):應與 image_id 相匹配。

string

true

conversations

與圖片關聯的一組問題與答案列表。

array

true

conversations {}

Name
Definition
Type
Required

question_id

問題的唯一識別碼,表示其 序列排名 (rank)。

integer

false

question

問題文本 (question_text)

  • 僅在導出 (export) 時為必填項。

  • 導入 (import) 時為可選項,系統會根據 Ontology 定義 自動填充問題文本。

  • 例如:"圖片中的公車是什麼顏色?" (What are the colors of the bus in the image?)

string

false

answer

答案來源 (Answer Sources)

  • groundtruth:人工標註的 標準答案 (ground truth answer)。

  • modelXXX:模型產生的 預測答案(將 modelXXX 替換為實際 模型 ID)。

object

false

circle-exclamation
circle-info

提醒 (Reminder)

導入數據時,只需提供 question_id。

問題內容 (question)(例如:"圖片中有公車嗎?")不是必需欄位,系統將會 自動忽略 該欄位。

系統將自動使用 Ontology(本體論)中定義的問題內容,無需手動輸入完整問題文本。

answer field {}

在 VLM 格式 中,答案欄位的格式根據問題的類型與預期回應格式而有所不同,並且必須符合系統的 ontology 設定。

下方列出了四種答案格式,包含其適用場景與範例:

type
Definition

Boolean

適用於 是/否 (Yes/No) 或 對/錯 (True/False) 類型的問題。 例如: "groundtruth": true

Option (List)

適用於 多選或分類問題,回答可能包含多個選項。 例如: "groundtruth": ["car"] 注意:

VLM 系統目前僅支援「單一選擇」,如果導入數據時提供了多個選項,系統會自動選擇列表中的第一個項目作為答案。

例如:"groundtruth": ["car", "bus"] → 系統將自動選擇 "car" 作為答案。

Number

適用於 數量相關問題,如「圖片中有多少輛車?」。 例如: "groundtruth": 3

Text

適用於需要開放式回答的問題,如「請描述圖片中的場景」。 例如: "groundtruth": "The bus is red and white."


數據結構

數據集主要組織為兩個主要資料夾:

  1. 圖片資料夾 (images/)

  2. 標註資料夾 (annotations/)

每張圖片都有唯一 ID,並與對應的標註數據 通過唯一 ID 進行關聯。

File Structure

文件結構

  1. 圖片資料夾 (images/)

    • 存放所有圖片文件。

    • 支援格式:JPG、PNG。

    • 每張圖片的名稱必須唯一,且名稱需與對應的 標註 ID 匹配。

  2. 標註資料夾 (annotations/)

    • 存放 JSON 標註文件。

    • 每個 JSON 文件可包含多個標註條目,以避免單個文件過於龐大。

    • 可根據邏輯需求拆分 JSON 文件(例如依據 圖片批次、類別、或自訂條件 進行分類)。

Last updated