Skip to main content

JSON Data Structure

All training data must follow a standardized JSON format with the following components:

Required Fields

  • Media field: Either image or video containing the path to media files
  • conversations: An array of conversation turns with from and value fields

Media Tags

Use special tokens in prompts to indicate media placement:
  • <image> for image understanding tasks
  • <video> for video understanding tasks
Important formatting rules:
  • One <image> tag must correspond to exactly one image file
  • Similarly, <video> tags must correspond to video files
  • These special tokens should NOT appear in the answer text

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:
If you have grounding data in a different format, use the tools/process_bbox.ipynb notebook to transform your data into the QwenVL format.

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-10M
  • lmms-lab/LLaVA-NeXT-Data
  • FreedomIntelligence/ALLaVA-4V
  • TIGER-Lab/VisualWebInstruct

Example Files

The repository includes example datasets:
  • demo/single_images.json - Single image examples
  • demo/video.json - Video understanding examples
These files can be used directly for training or as templates for your own datasets.