[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-24。"],[],[],null,["# Image tuning\n\nThis page provides prerequisites and detailed instructions for fine-tuning\nGemini on image data using supervised learning.\n\nUse cases\n---------\n\nFine-tuning lets you adapt base Gemini models for specialized tasks.\nHere are some image use cases:\n\n- **Product catalog enhancement**: Extract key attributes from images (e.g., brand, color, size) to automatically build and enrich your product catalog.\n- **Image moderation**: Fine-tune a model to detect and flag inappropriate or harmful content in images, ensuring a safer online experience.\n- **Visual inspection**: Train a model to identify specific objects or defects within images, automating quality control or inspection processes.\n- **Image classification**: Improve the accuracy of image classification for specific domains, such as medical imaging or satellite imagery analysis.\n- **Image-based recommendations**: Analyze images to provide personalized recommendations, such as suggesting similar products or complementary items.\n- **Table content extraction**: Extract data from tables within images and convert it into structured formats like spreadsheets or databases.\n\nLimitations\n-----------\n\n- Maximum images per example: 30\n- Maximum image file size: 20MB\n\nTo learn more about image sample requirements, see the [Image understanding](/vertex-ai/generative-ai/docs/multimodal/image-understanding#image-requirements) page.\n\nDataset format\n--------------\n\nThe `fileUri` for your dataset can be the URI for a file in a Cloud Storage\nbucket, or it can be a publicly available HTTP or HTTPS URL.\n\nTo see the generic format example, see\n[Dataset example for Gemini](/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning-prepare#dataset-example).\n\nThe following is an example of an image dataset. \n\n {\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"fileData\": {\n \"mimeType\": \"image/jpeg\",\n \"fileUri\": \"gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/image/longcap100/100.jpeg\"\n }\n }, \n {\n \"text\": \"Describe this image in detail that captures the essence of it.\"\n }\n ]\n }, \n {\n \"role\": \"model\",\n \"parts\": [\n {\n \"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.\"\n }\n ]\n }\n ]\n }\n\n### Sample datasets\n\nYou can use the following sample datasets to learn how to tune a\nGemini model. To use these datasets, specify the URIs in the\napplicable parameters when creating a text model supervised fine-tuning job.\n\nTo use the sample tuning dataset, specify its location as follows: \n\n \"training_dataset_uri\": \"gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_train_data.jsonl\",\n\nTo use the sample validation dataset, specify its location as follows: \n\n \"validation_dataset_uri\": \"gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_validation_data.jsonl\",\n\nWhat's next\n-----------\n\n- To learn more about the image understanding capability of Gemini, see our [Image understanding](/vertex-ai/generative-ai/docs/multimodal/image-understanding) documentation.\n- To start tuning, see [Tune Gemini models by using supervised fine-tuning](/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning)\n- To learn how supervised fine-tuning can be used in a solution that builds a generative AI knowledge base, see [Jump Start Solution: Generative AI\n knowledge base](/architecture/ai-ml/generative-ai-knowledge-base)."]]