2020-11-13 23:28:32 +08:00
2020-11-13 17:41:05 +08:00
2020-11-13 23:20:24 +08:00
2020-11-13 23:28:32 +08:00
2020-11-13 23:28:32 +08:00
2020-11-12 13:46:25 +08:00
2020-11-13 23:28:32 +08:00

RIFE

arXiv

We are working on arranging our training code and other scripts.

Our model can run 30+FPS for 2X interpolation on 2080Ti GPU. We also support CPU device including MacOS.

16X interpolation results from two input images:

Demo Demo

Abstract

We propose a real-time intermediate flow estimation algorithm (RIFE) for video frame interpolation (VFI). Most existing methods first estimate the bi-directional optical flows, and then linearly combine them to approximate intermediate flows, leading to artifacts around motion boundaries. We design an intermediate flow model named IFNet that can directly estimate the intermediate flows from coarse to fine. We then warp the input frames according to the estimated intermediate flows and employ a fusion process to compute final results. Based on our proposed leakage distillation, RIFE can be trained end-to-end and achieve excellent performance. Experiments demonstrate that RIFE is significantly faster than existing flow-based VFI methods and achieves state-of-the-art index on several benchmarks.

Dependencies

pip3 install torch==1.6.0
pip3 install numpy
pip3 install opencv-python

Usage

  • Download the pretrained models from here

(We also provide 百度网盘 source. 链接: https://pan.baidu.com/s/17tHd-syovvRGP2C6UVPsIw 提取码: 5ha7)

  • Unzip and move the pretrained parameters to train_log/*.pkl

Image Interpolation

$ python3 inference_img.py --img img0.png img1.png --times=5
(You will get 32x interpolation results in default.)
$ ffmpeg -r 10 -f image2 -i output/img%d.png -s 448x256 -c:v libx264 -pix_fmt yuv420p output/slomo.mp4 -q:v 0 -q:a 0
(You will get a slomo video based on two input images.)
$ ffmpeg -r 10 -f image2 -i output/img%d.png -s 448x256 -vf "split[s0][s1];[s0]palettegen=stats_mode=single[p];[s1][p]paletteuse=new=1" output/slomo.gif

Video 2x Interpolation

$ python3 inference_mp4_2x.py --video video.mp4

Citation

@article{huang2020rife,
  title={RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation},
  author={Huang, Zhewei and Zhang, Tianyuan and Heng, Wen and Shi, Boxin and Zhou, Shuchang},
  journal={arXiv preprint arXiv:2011.06294},
  year={2020}
}

Reference

Optical Flow: ARFlow pytorch-liteflownet RAFT

Video Interpolation: DAIN CAIN AdaCoF-pytorch

Description
ECCV2022 - Real-Time Intermediate Flow Estimation for Video Frame Interpolation
Readme MIT 91 MiB
Languages
Python 96.6%
Jupyter Notebook 2.9%
Dockerfile 0.4%