Unified Multi-modal Transformers
This repository maintains the official implementation of the paper UMT: Unified Multi-modal Transformers for Joint Video Moment Retrieval and Highlight Detection by Ye Liu, Siyuan Li, Yang Wu, Chang Wen Chen, Ying Shan, and Xiaohu Qie, which has been accepted by CVPR 2022.
Installation
Please refer to the following environmental settings that we use. You may install these packages by yourself if you meet any problem during automatic installation.
- CUDA 11.5.0
- CUDNN 8.3.2.44
- Python 3.10.0
- PyTorch 1.11.0
- NNCore 0.3.6
Install from source
- Clone the repository from GitHub.
git clone https://github.com/TencentARC/UMT.git
cd UMT
- Install dependencies.
pip install -r requirements.txt
Getting Started
Download and prepare the datasets
- Download and extract the datasets.
- Prepare the files in the following structure.
UMT
βββ configs
βββ datasets
βββ models
βββ tools
βββ data
β βββ qvhighlights
β β βββ *features
β β βββ highlight_{train,val,test}_release.jsonl
β β βββ subs_train.jsonl
β βββ charades
β β βββ *features
β β βββ charades_sta_{train,test}.txt
β βββ youtube
β β βββ *features
β β βββ youtube_anno.json
β βββ tvsum
β βββ *features
β βββ tvsum_anno.json
βββ README.md
βββ setup.cfg
βββ Β·Β·Β·
Train a model
Run the following command to train a model using a specified config.
# Single GPU
python tools/launch.py ${path-to-config}
# Multiple GPUs
torchrun --nproc_per_node=${num-gpus} tools/launch.py ${path-to-config}
Test a model and evaluate results
Run the following command to test a model and evaluate results.
python tools/launch.py ${path-to-config} --checkpoint ${path-to-checkpoint} --eval
Pre-train with ASR captions on QVHighlights
Run the following command to pre-train a model using ASR captions on QVHighlights.
torchrun --nproc_per_node=4 tools/launch.py configs/qvhighlights/umt_base_pretrain_100e_asr.py
Model Zoo
We provide multiple pre-trained models and training logs here. All the models are trained with a single NVIDIA Tesla V100-FHHL-16GB GPU and are evaluated using the default metrics of the datasets.
Dataset | Model | Type | MR mAP | HD mAP | Download | ||
---|---|---|---|---|---|---|---|
[email protected] | [email protected] | [email protected] | [email protected] | ||||
QVHighlights | UMT-B | β | 38.59 | 39.85 | model | metrics | ||
UMT-B | w/ PT | 39.26 | 40.10 | model | metrics | |||
Charades-STA | UMT-B | V + A | 48.31 | 29.25 | 88.79 | 56.08 | model | metrics |
UMT-B | V + O | 49.35 | 26.16 | 89.41 | 54.95 | model | metrics | |
YouTube Highlights |
UMT-S | Dog | β | 65.93 | model | metrics | ||
UMT-S | Gymnastics | β | 75.20 | model | metrics | |||
UMT-S | Parkour | β | 81.64 | model | metrics | |||
UMT-S | Skating | β | 71.81 | model | metrics | |||
UMT-S | Skiing | β | 72.27 | model | metrics | |||
UMT-S | Surfing | β | 82.71 | model | metrics | |||
TVSum | UMT-S | VT | β | 87.54 | model | metrics | ||
UMT-S | VU | β | 81.51 | model | metrics | |||
UMT-S | GA | β | 88.22 | model | metrics | |||
UMT-S | MS | β | 78.81 | model | metrics | |||
UMT-S | PK | β | 81.42 | model | metrics | |||
UMT-S | PR | β | 86.96 | model | metrics | |||
UMT-S | FM | β | 75.96 | model | metrics | |||
UMT-S | BK | β | 86.89 | model | metrics | |||
UMT-S | BT | β | 84.42 | model | metrics | |||
UMT-S | DS | β | 79.63 | model | metrics |
Here, w/ PT
means initializing the model using pre-trained weights on ASR captions. V
, A
, and O
indicate video, audio, and optical flow, respectively.
Citation
If you find this project useful for your research, please kindly cite our paper.
@inproceedings{liu2022umt,
title={UMT: Unified Multi-modal Transformers for Joint Video Moment Retrieval and Highlight Detection},
author={Liu, Ye and Li, Siyuan and Wu, Yang and Chen, Chang Wen and Shan, Ying and Qie, Xiaohu},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
pages={3042--3051},
year={2022}
}