本頁面提供使用監督式學習精細調整 Gemini 圖像資料的先決條件和詳細操作說明。
用途
您可以微調基礎 Gemini 模型,以便執行專門工作。以下是一些圖片用途:
- 產品目錄強化功能:從圖片中擷取主要屬性 (例如品牌、顏色、尺寸),自動建立並豐富產品目錄。
- 圖片審核:精細調整模型,偵測並標記圖片中的不當或有害內容,確保更安全的上網體驗。
- 目視檢測:訓練模型來識別圖片中的特定物件或瑕疵,自動執行品質管制或檢查程序。
- 圖片分類:改善特定領域的圖片分類準確度,例如醫學影像或衛星圖像分析。
- 以圖片為基礎的推薦內容:分析圖片以提供個人化推薦內容,例如類似產品或互補商品。
- 表格內容擷取:從圖片中的表格擷取資料,並轉換為試算表或資料庫等結構化格式。
限制
- 每個示例的圖片數量上限:30 張
- 圖片檔案大小上限:20 MB
如要進一步瞭解圖像樣本規定,請參閱「圖像理解」頁面。
資料集格式
資料集的 fileUri
可以是 Cloud Storage 值區中檔案的 URI,也可以是公開的 HTTP 或 HTTPS 網址。
如要查看通用格式範例,請參閱 Gemini 的資料集範例。
以下是圖片資料集的範例。
{
"contents": [
{
"role": "user",
"parts": [
{
"fileData": {
"mimeType": "image/jpeg",
"fileUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/image/longcap100/100.jpeg"
}
},
{
"text": "Describe this image in detail that captures the essence of it."
}
]
},
{
"role": "model",
"parts": [
{
"text": "A man stands on a road, wearing a blue denim jacket, tan pants, and white sneakers. He has his hands in his pockets and is wearing a white t-shirt under his jacket. The man's pants are cuffed, and his shoes are white. The road is dark grey, and the leaves are green. The man is standing in the shade, and the light is shining on the ground."
}
]
}
]
}
範例資料集
您可以使用下列樣本資料集,瞭解如何調整 Gemini 模型。如要使用這些資料集,請在建立文字模型監督微調工作時,在適用的參數中指定 URI。
如要使用範例調整用資料集,請按照下列方式指定位置:
"training_dataset_uri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_train_data.jsonl",
如要使用驗證資料集範例,請按照下列方式指定位置:
"validation_dataset_uri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_validation_data.jsonl",
後續步驟
- 如要進一步瞭解 Gemini 的圖像理解功能,請參閱圖像理解說明文件。
- 如要開始調整,請參閱「使用監督式微調功能調整 Gemini 模型」
- 如要瞭解如何在建構生成式 AI 知識庫的解決方案中使用監督式精修,請參閱「快速部署解決方案:生成式 AI 知識庫」。