- 🧩 Environment Instructions
- 📦 Setup: Download Pre-trained Models
- 🧪 Running the Model on AudioCaps
- 🎵 Running the Model on Clotho
- 🔁 Running the Model on SynCaps
- 🧬 Generating SynCaps
- 📖 Citation
- ✉️ Contact
- 🙏 Acknowledgements
- ⚖️ License
conda env create -f environment.yml
conda activate pt39Download the HTSAT.ckp model from this Google Drive link
and place it under:
retrieval/pretrained_models/audio_encoders/
More info can be found in the WavCaps repo.
Alternatively, use the following commands:
cd retrieval
mkdir -p pretrained_models/audio_encoder
gdown --output pretrained_models/audio_encoder/HTSAT.ckpt "https://drive.google.com/uc?id=11XiCDsW3nYJ6uM87pvP3wI3pDAGhsBC1"Download the pre-trained WavCaps model:
mkdir pretrained
gdown --output pretrained/HTSAT-BERT-PT.pt "https://drive.google.com/uc?id=1il6X1EiUPlbyysM9hn2CYr-YRSCuSy2m"Then, update the pretrain_path in:
retrieval/settings/train_ac_trans.yaml
to point to the full path of your downloaded model.
From the retrieval folder, run:
python train.py --config settings/train_ac_trans.yaml --exp_name <experiment_name> --lambda_new_loss 0 --val_filename val_audioset_5_orig --train_filename train_audioset_orig --test_filename test_full --seed 18Notes:
- Replace the
pretrain_pathinsettings/train_ac_trans.yamlwith your pretrained model path. - Set
lambda_new_lossto:10→ reproduce experiments using the additional loss.0→ use the standard text–audio contrastive loss.
- You can specify dataset versions:
- Original AudioCaps:
--train_filename train_audioset_orig --val_filename val_audioset_5_orig --test_filename test_full
- Uniform version:
--train_filename train_audioset_rearranged --val_filename val_audioset_5_rearranged --test_filename test_audioset_5_rearranged
- Original AudioCaps:
Training logs and final results are saved under:
retrieval/outputs/<exp_name>/logging
To evaluate on AudioCaps (original version):
python test_improved.py --config settings/inference_ac_orig.yaml --exp_name <experiment_name> --lambda_new_loss 0 --val_filename val_audioset_5_orig --train_filename train_audioset_orig --test_filename test_full --seed 19- Update the checkpoint path in:
retrieval/settings/inference_ac_orig.yaml - Pre-trained checkpoints used in the paper are available here.
Run the following from the retrieval folder:
python train.py --config settings/train_clotho_trans.yaml --exp_name clotho_train --seed 18 --lambda_new_loss 10 --train_filename train_individualUpdate the path of the pretrained model in:
retrieval/settings/train_clotho_trans.yaml
python test_improved.py --config settings/inference_clotho.yaml --exp_name clotho_eval --lambda_new_loss 0 --train_filename train_individual --seed 18- Update the checkpoint path in:
retrieval/settings/inference_clotho.yaml - Paper checkpoints: Google Drive link.
python train.py --config settings/train_syncaps.yaml --exp_name syncaps_train --lambda_new_loss 0 --seed 19python test_improved.py --config settings/inference_syncaps.yaml --exp_name syncaps --lambda_new_loss 0 --seed 19- Update the checkpoint path in:
retrieval/settings/inference_syncaps.yaml - Checkpoints used in the paper can be found here.
To generate SynCaps, run:
python retrieval/tools/syncaps_gen.pyIf you find our work useful, please cite the following:
@InProceedings{Oncescu24,
author = {Andreea-Maria Oncescu and Joao~F. Henriques and A. Sophia Koepke},
title = {Dissecting Temporal Understanding in Text-to-Audio Retrieval},
booktitle = {ACM International Conference on Multimedia},
year = {2024},
doi = {https://doi.org/10.1145/3664647.3681690},
}
@article{mei2023wavcaps,
title={WavCaps: A ChatGPT-Assisted Weakly-Labelled Audio Captioning Dataset for Audio-Language Multimodal Research},
author={Mei, Xinhao and Meng, Chutong and Liu, Haohe and Kong, Qiuqiang and Ko, Tom and Zhao, Chengqi and Plumbley, Mark D and Zou, Yuexian and Wang, Wenwu},
journal={arXiv:2303.17395},
year={2023}
}
@inproceedings{piczak2015dataset,
title = {{ESC}: {Dataset} for {Environmental Sound Classification}},
author = {Piczak, Karol J.},
booktitle = {{Association for Computing Machinery (ACM) Conference} on {Multimedia}},
year={2015},
}Maintained by Andreea.
For questions and discussions, contact:
📩 oncescuandreea@yahoo.com
This codebase is based on WavCaps.
Supported by:
- EPSRC DTA Studentship
- Royal Academy of Engineering (RF\201819\18\163)
- DFG: SFB 1233, Project 276693517
- DFG EXC 2064/1 – Project 390727645
Special thanks to Samuel Albanie and Bruno Korbar for helpful feedback and suggestions.
This work is licensed under a
Creative Commons Attribution–NonCommercial International 4.0 License.
