Giter VIP home page Giter VIP logo

ttvfi's Introduction

[TIP 2023] TTVFI

This is the official PyTorch implementation of the paper Learning Trajectory-Aware Transformer for Video Frame Interpolation.

Contents

Introduction

Contribution

  • We propose a novel trajectory-aware Transformer, which enables more accurate features learning of synthesis network by introducing Transformer into VFI tasks. Our method focuses on regions of video frames with motion consistency differences and performs attention with two kinds of well-designed visual tokens along the motion trajectory.
  • We propose a consistent motion learning module to generate the consistent motion in trajectory-aware Transformer, which is used to generate the trajectories and guide the learning of the attention mechanism in different regions.
  • Extensive experiments demonstrate that the proposed TTVFI can outperform existing state-of-the-art methods in four widely-used VFI benchmarks.

Overview

Visual

Requirements and dependencies

  • python 3.6 (recommend to use Anaconda)
  • pytorch == 1.2.0
  • torchvision == 0.4.0
  • opencv-python == 4.5.5
  • scikit-image == 0.17.2
  • scipy == 1.1.0
  • setuptools == 58.0.4
  • Pillow == 8.4.0
  • imageio == 2.15.0
  • numpy == 1.19.5

Model and Results

Pre-trained models can be downloaded from onedrive, google drive, and baidu cloud(j3nd).

  • TTVFI_stage1.pth: trained from first stage with consistent motion learning.
  • TTVFI_stage2.pth: trained from second stage with trajectory-aware Transformer on Viemo-90K dataset.

The output results on Vimeo-90K testing set, DAVIS, UCF101 and SNU-FILM can be downloaded from onedrive, google drive, and baidu cloud(j3nd).

Dataset

  1. Training set

    • Viemo-90K dataset. Download the both triplet training and test set. The tri_trainlist.txt file listing the training samples in the download zip file.
      • Make Vimeo-90K structure be:
       	├────vimeo_triplet
       		├────sequences
       			├────00001
       			├────...
       			├────00078
       		├────tri_trainlist.txt
       		├────tri_testlist.txt
      
  2. Testing set

    • Viemo-90K testset. The tri_testlist.txt file listing the testing samples in the download zip file.
    • DAVIS, UCF101, and SNU-FILM dataset.
      • Make DAVIS, UCF101, and SNU-FILM structure be:
       	├────DAVIS
       		├────input
       		├────gt
       	├────UCF101
       		├────1
       		├────...
       	├────SNU-FILM
       		├────test
       			├────GOPRO_test
       			├────YouTube_test
       		├────test-easy.txt			
       		├────...		
       		├────test-extreme.txt		
      

Demo

  1. Clone this github repo
git clone https://github.com/ChengxuLiu/TTVFI.git
cd TTVFI
  1. Generate the Correlation package required by PWCNet:
cd ./models/PWCNet/correlation_package_pytorch1_0/
./build.sh
  1. Download pre-trained weights (onedrive|google drive|baidu cloud(j3nd)) under ./checkpoint
cd ../../..
mkdir checkpoint
  1. Prepare input frames and modify "FirstPath" and "SecondPath" in ./demo.py
  2. Run demo
python demo.py

Test

  1. Clone this github repo
git clone https://github.com/ChengxuLiu/TTVFI.git
cd TTVFI
  1. Generate the Correlation package required by PWCNet:
cd ./models/PWCNet/correlation_package_pytorch1_0/
./build.sh
  1. Download pre-trained weights (onedrive|google drive|baidu cloud(j3nd)) under ./checkpoint
cd ../../..
mkdir checkpoint
  1. Prepare testing dataset and modify "datasetPath" in ./test.py
  2. Run test
mkdir weights
# Vimeo
python test.py

Train

  1. Clone this github repo
git clone https://github.com/ChengxuLiu/TTVFI.git
cd TTVFI
  1. Generate the Correlation package required by PWCNet:
cd ./models/PWCNet/correlation_package_pytorch1_0/
./build.sh
  1. Prepare training dataset and modify "datasetPath" in ./train_stage1.py and ./train_stage2.py
  2. Run training of stage1
mkdir weights
# stage one
python train_stage1.py
  1. The models of stage1 are saved in ./weights and fed into stage2 (modify "pretrained" in ./train_stage2.py)
  2. Run training of stage2
# stage two
python train_stage2.py
  1. The models of stage2 are also saved in ./weights

Citation

If you find the code and pre-trained models useful for your research, please consider citing our paper. 😊

@article{liu2023ttvfi,
  title={Ttvfi: Learning trajectory-aware transformer for video frame interpolation},
  author={Liu, Chengxu and Yang, Huan and Fu, Jianlong and Qian, Xueming},
  journal={IEEE Transactions on Image Processing},
  year={2023},
  publisher={IEEE}
}

Contact

If you meet any problems, please describe them in issues or contact:

ttvfi's People

Contributors

chengxuliu avatar

Stargazers

Taewoo kim avatar  avatar  avatar  avatar Tiankai Hang avatar Huan Yang avatar  avatar

Watchers

Elexor avatar Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.