This repository contains the music captioning pipeline used for the ICME 2026 ATTM Grand Challenge. The pipeline provides two approaches for generating detailed music captions from audio files, leveraging state-of-the-art audio-language models.
Note: The official reference captions are already processed and provided at https://github.com/ntu-musicailab/ICME26-ATTM-GC-MeanAudio/tree/main/data/captions. This repository serves only as a demonstration and reference to encourage participants to explore data augmentation approaches or better leverage audio-language models (ALMs) in their solutions.
The pipeline consists of two main captioning approaches:
jamendo_qwen.jsonjamendo_mf.json┌─────────────────────────────────────────────────────────────┐
│ Pipeline A │
│ │
│ Audio Files → qwen_caption.py → jamendo_qwen.json │
│ (Qwen2-Audio) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Pipeline B │
│ │
│ Audio Files → mf_caption.py → mf_initial.json │
│ (Music Flamingo) │
│ │
│ ↓ │
│ │
│ qwen_rephrase.py → jamendo_mf_rephrased.json │
│ (Qwen3-4B) │
│ │
│ ↓ │
│ │
│ create_final_json.py → jamendo_mf.json │
│ (Format standardization) │
└─────────────────────────────────────────────────────────────┘
# Clone the repository
git clone https://github.com/yourusername/ICME26-ATTM-GC-ALM-captioning-pipeline.git
cd ICME26-ATTM-GC-ALM-captioning-pipeline
Please refer to the original model repositories for detailed installation instructions and dependencies:
Qwen2-Audio-7B-Instruct (for Pipeline A and general captioning):
https://huggingface.co/Qwen/Qwen2-Audio-7B-Instruct
Music Flamingo (for Pipeline B Step 1):
https://github.com/NVIDIA/audio-flamingo/tree/music_flamingo
Qwen3-4B-Instruct (for Pipeline B Step 2 - rephrasing):
https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507
Each repository provides specific installation requirements and setup instructions.
Generate captions using Qwen2-Audio model:
python qwen_caption.py /path/to/audio/dir output/jamendo_qwen.json
Options:
--prompt: Custom prompt for captioning (default focuses on instrumental description)--batch-size: Batch size for processing (default: 6)--test: Test mode - process only first batch and print to terminalExample with custom prompt:
python qwen_caption.py /data/music output.json \
--prompt "Describe the genre, mood, and instrumentation of this track" \
--batch-size 8
Test mode for prompt tuning:
python qwen_caption.py /data/music test_output.json --test
python mf_caption.py /path/to/audio/dir output/mf_initial.json
Options:
--prompt: Custom prompt for captioning--batch-size: Batch size (default: 6)--test: Test modeExample:
python mf_caption.py /data/music mf_initial.json --batch-size 6
python qwen_rephrase.py output/mf_initial.json output/mf_rephrased.json
Options:
--instruction: Custom rephrasing instruction--batch-size: Batch size (default: 8)--test: Test mode for instruction tuningExample with custom instruction:
python qwen_rephrase.py mf_initial.json mf_rephrased.json \
--instruction "Your custom rephrasing instruction here" \
--batch-size 8
python create_final_json.py output/mf_rephrased.json output/jamendo_mf.json
All scripts produce JSON files with the following standard format:
[
{
"path": "relative/path/to/audio.mp3",
"caption": "Generated caption describing the music..."
},
...
]
The rephrasing step (qwen_rephrase.py) produces an intermediate format that includes both original and rephrased captions, which is then cleaned up by create_final_json.py.
All scripts support automatic resuming from interruptions:
Use --test flag to process only the first batch for:
Configurable batch sizes to optimize for your GPU memory:
--batch-size based on available VRAM| Model | Size | Purpose | HuggingFace ID |
|---|---|---|---|
| Qwen2-Audio | 7B | Direct audio captioning | Qwen/Qwen2-Audio-7B-Instruct |
| Music Flamingo | 3B | Audio captioning | nvidia/music-flamingo-hf |
| Qwen3-4B | 4B | Caption rephrasing | Qwen/Qwen3-4B-Instruct-2507 |
This pipeline can be used as a reference for data augmentation approaches:
This repository contains the music captioning pipeline used for the ICME 2026 ATTM Grand Challenge. The pipeline provides two approaches for generating detailed music captions from audio files, leveraging state-of-the-art audio-language models.
Note: The official reference captions are already processed and provided at https://github.com/ntu-musicailab/ICME26-ATTM-GC-MeanAudio/tree/main/data/captions. This repository serves only as a demonstration and reference to encourage participants to explore data augmentation approaches or better leverage audio-language models (ALMs) in their solutions.
The pipeline consists of two main captioning approaches:
jamendo_qwen.jsonjamendo_mf.json┌─────────────────────────────────────────────────────────────┐
│ Pipeline A │
│ │
│ Audio Files → qwen_caption.py → jamendo_qwen.json │
│ (Qwen2-Audio) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Pipeline B │
│ │
│ Audio Files → mf_caption.py → mf_initial.json │
│ (Music Flamingo) │
│ │
│ ↓ │
│ │
│ qwen_rephrase.py → jamendo_mf_rephrased.json │
│ (Qwen3-4B) │
│ │
│ ↓ │
│ │
│ create_final_json.py → jamendo_mf.json │
│ (Format standardization) │
└─────────────────────────────────────────────────────────────┘
# Clone the repository
git clone https://github.com/yourusername/ICME26-ATTM-GC-ALM-captioning-pipeline.git
cd ICME26-ATTM-GC-ALM-captioning-pipeline
Please refer to the original model repositories for detailed installation instructions and dependencies:
Qwen2-Audio-7B-Instruct (for Pipeline A and general captioning):
https://huggingface.co/Qwen/Qwen2-Audio-7B-Instruct
Music Flamingo (for Pipeline B Step 1):
https://github.com/NVIDIA/audio-flamingo/tree/music_flamingo
Qwen3-4B-Instruct (for Pipeline B Step 2 - rephrasing):
https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507
Each repository provides specific installation requirements and setup instructions.
Generate captions using Qwen2-Audio model:
python qwen_caption.py /path/to/audio/dir output/jamendo_qwen.json
Options:
--prompt: Custom prompt for captioning (default focuses on instrumental description)--batch-size: Batch size for processing (default: 6)--test: Test mode - process only first batch and print to terminalExample with custom prompt:
python qwen_caption.py /data/music output.json \
--prompt "Describe the genre, mood, and instrumentation of this track" \
--batch-size 8
Test mode for prompt tuning:
python qwen_caption.py /data/music test_output.json --test
python mf_caption.py /path/to/audio/dir output/mf_initial.json
Options:
--prompt: Custom prompt for captioning--batch-size: Batch size (default: 6)--test: Test modeExample:
python mf_caption.py /data/music mf_initial.json --batch-size 6
python qwen_rephrase.py output/mf_initial.json output/mf_rephrased.json
Options:
--instruction: Custom rephrasing instruction--batch-size: Batch size (default: 8)--test: Test mode for instruction tuningExample with custom instruction:
python qwen_rephrase.py mf_initial.json mf_rephrased.json \
--instruction "Your custom rephrasing instruction here" \
--batch-size 8
python create_final_json.py output/mf_rephrased.json output/jamendo_mf.json
All scripts produce JSON files with the following standard format:
[
{
"path": "relative/path/to/audio.mp3",
"caption": "Generated caption describing the music..."
},
...
]
The rephrasing step (qwen_rephrase.py) produces an intermediate format that includes both original and rephrased captions, which is then cleaned up by create_final_json.py.
All scripts support automatic resuming from interruptions:
Use --test flag to process only the first batch for:
Configurable batch sizes to optimize for your GPU memory:
--batch-size based on available VRAM| Model | Size | Purpose | HuggingFace ID |
|---|---|---|---|
| Qwen2-Audio | 7B | Direct audio captioning | Qwen/Qwen2-Audio-7B-Instruct |
| Music Flamingo | 3B | Audio captioning | nvidia/music-flamingo-hf |
| Qwen3-4B | 4B | Caption rephrasing | Qwen/Qwen3-4B-Instruct-2507 |
This pipeline can be used as a reference for data augmentation approaches: