T-CoRe

March 20, 2025 ยท View on GitHub

This is the official code for the paper "When the Future Becomes the Past: Taming Temporal Correspondence for Self-supervised Video Representation Learning" accepted by Conference on Computer Vision and Pattern Recognition (CVPR 2025). This paper is available at here.

paper slides Website video

When the Future Becomes the Past: Taming Temporal Correspondence for Self-supervised Video Representation Learning

Authors: Yang Liu, Qianqian Xu*, Peisong Wen, Siran Dai, Qingming Huang*

assets/pipeline.png

๐Ÿšฉ Checkpoints

DatasetBackboneEpochJ\\&F_mmIoUPCK@0.1Download
ImageNetVIT-S/1610064.139.746.2link
K400VIT-S/1640064.737.847.0link
K400VIT-B/1620066.438.947.1link

๐Ÿ’ป Environments

  • Ubuntu 20.04
  • CUDA 12.4
  • Python 3.9
  • Pytorch 2.2.0

See requirement.txt for others.

๐Ÿ”ง Installation

  1. Clone this repository

    git clone https://github.com/yafeng19/T-CORE.git
    
  2. Create a virtual environment with Python 3.9 and install the dependencies

    conda create --name T_CORE python=3.9
    conda activate T_CORE
    
  3. Install the required libraries

    pip install -r requirements.txt
    

๐Ÿš€ Training

Dataset

  1. Download Kinetics-400 training set.
  2. Use third-party tools or scripts to extract frames from original videos.
  3. Place the frames in data/Kinetics-400/frames/train.
  4. Generate files for training data by python base_model/tools/dump_files.py and plce the files in data/Kinetics-400/frames.
  5. Integrate the frames and files into the following structure:
    T-CoRe
    โ”œโ”€โ”€ data
    โ”‚   โ””โ”€โ”€ Kinetics-400
    โ”‚       โ””โ”€โ”€ frames
    โ”‚           โ”œโ”€โ”€ train
    โ”‚           โ”‚   โ”œโ”€โ”€ class_1
    โ”‚           โ”‚   โ”‚   โ”œโ”€โ”€ video_1
    โ”‚           โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ 00000.jpg
    โ”‚           โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ 00001.jpg
    โ”‚           โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ...
    โ”‚           โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ 00019.jpg
    โ”‚           โ”‚   โ”‚   โ”œโ”€โ”€ ...
    โ”‚           โ”‚   โ”‚   โ””โ”€โ”€ video_m
    โ”‚           โ”‚   โ”œโ”€โ”€ ...
    โ”‚           โ”‚   โ””โ”€โ”€ class_n
    โ”‚           โ”œโ”€โ”€ class-ids-TRAIN.npy
    โ”‚           โ”œโ”€โ”€ class-names-TRAIN.npy
    โ”‚           โ”œโ”€โ”€ entries-TRAIN.npy
    โ”‚           โ””โ”€โ”€ labels.txt
    โ”œโ”€โ”€ base_model
    โ””โ”€โ”€ scripts
    

Scripts

We provide a script with default parameters. Run the following command for training.

bash scripts/pretrain.sh

The well-trained models are saved at here.

๐Ÿ“Š Evaluation

Dataset

In our paper, three dense-level benchmarks are adopted for evaluation.

DatasetVideo TaskDownload link
DAVISVideo Object Segmentationlink
JHMDBHuman Pose Propagationlink
VIPSemantic Part Propagationlink

Scripts

We provide a script with default parameters. Run the following command for evaluation.

bash scripts/eval.sh

๐Ÿ–‹๏ธ Citation

If you find this repository useful in your research, please cite the following papers:

@misc{liu2025futurepasttamingtemporal,
      title={When the Future Becomes the Past: Taming Temporal Correspondence for Self-supervised Video Representation Learning}, 
      author={Yang Liu and Qianqian Xu and Peisong Wen and Siran Dai and Qingming Huang},
      year={2025},
      eprint={2503.15096},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2503.15096}, 
}

๐Ÿ“ง Contact us

If you have any detailed questions or suggestions, you can email us: liuyang232@mails.ucas.ac.cn. We will reply in 1-2 business days. Thanks for your interest in our work!

๐ŸŒŸ Acknowledgements

  • Our code is based on the official PyTorch implementation of DINOv2.
  • The evaluation code is based on CropMAE.