JSON Data Structure
All training data must follow a standardized JSON format with the following components:Required Fields
- Media field: Either
imageorvideocontaining the path to media files - conversations: An array of conversation turns with
fromandvaluefields
Media Tags
Use special tokens in prompts to indicate media placement:<image>for image understanding tasks<video>for video understanding tasks
Example Formats
Single Image Example
Basic single-image question-answering format:Multi-Image Example
For tasks requiring comparison or reasoning across multiple images:The number of
<image> tags in the prompt must match the number of images in the image array.Video Example
For video understanding and temporal reasoning tasks:Grounding Example
For object detection and localization tasks:Packed Data Example
For improved training efficiency, multiple samples can be packed into a single sequence:To use packed data, preprocess your dataset with
tools/pack_data.py and set data_packing=True in your training configuration.File Organization
Your dataset can be organized in two ways:Option 1: Relative Paths with data_path
Option 2: Absolute Paths
Data Validation
For open-source datasets that might have missing images or other issues, verify data completeness using:Available Public Datasets
You can use these datasets directly without additional processing:nyu-visionx/Cambrian-10Mlmms-lab/LLaVA-NeXT-DataFreedomIntelligence/ALLaVA-4VTIGER-Lab/VisualWebInstruct
Example Files
The repository includes example datasets:demo/single_images.json- Single image examplesdemo/video.json- Video understanding examples