Files
ECCV2022-RIFE/README.md

65 lines
3.2 KiB
Markdown
Raw Normal View History

2020-11-12 17:31:40 +08:00
# RIFE
2020-11-14 02:22:02 +08:00
## [arXiv](https://arxiv.org/pdf/2011.06294.pdf) | [Reddit](https://www.reddit.com/r/MachineLearning/comments/jtl37r/r_realtime_720p_flowbased_video_frame/)
2020-11-14 14:05:02 +08:00
2020-11-14 14:10:29 +08:00
**You can easily use [colaboratory](https://colab.research.google.com/github/hzwer/arXiv2020-RIFE/blob/main/Video_2x.ipynb) to have a try.**
2020-11-14 14:05:02 +08:00
2020-11-14 02:48:43 +08:00
Our model can run 30+FPS for 2X 720p interpolation on a 2080Ti GPU. We also support CPU device including MacOS system. Currently our method supports multi-frame interpolation between a pair of images and 2X interpolation for video. Everyone is welcome to use this alpha version and make suggestions!
2020-11-12 20:27:43 +08:00
2020-11-13 20:24:27 +08:00
16X interpolation results from two input images:
2020-11-13 18:41:50 +08:00
![Demo](./demo/I0_slomo_clipped.gif)
![Demo](./demo/I2_slomo_clipped.gif)
2020-11-13 18:24:04 +08:00
2020-11-12 17:31:40 +08:00
## 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.
2020-11-12 20:27:43 +08:00
## Dependencies
```
2020-11-12 23:45:48 +08:00
pip3 install torch==1.6.0
2020-11-12 20:27:43 +08:00
pip3 install numpy
2020-11-12 23:45:48 +08:00
pip3 install opencv-python
2020-11-12 20:27:43 +08:00
```
2020-11-13 23:28:32 +08:00
## Usage
2020-11-12 20:27:43 +08:00
* Download the pretrained models from [here](https://drive.google.com/file/d/1c1R7iF-ypN6USo-D2YH_ORtaH3tukSlo/view?usp=sharing)
2020-11-13 01:44:56 +08:00
(We also provide 百度网盘 source. 链接: https://pan.baidu.com/s/17tHd-syovvRGP2C6UVPsIw 提取码: 5ha7)
2020-11-13 00:06:58 +08:00
* Unzip and move the pretrained parameters to train_log/\*.pkl
2020-11-12 23:39:28 +08:00
2020-11-13 23:28:32 +08:00
**Image Interpolation**
2020-11-12 23:39:28 +08:00
```
2020-11-14 02:54:24 +08:00
$ python3 inference_img.py --img img0.png img1.png --times=4
(2^4=16X interpolation results)
2020-11-13 17:42:43 +08:00
$ 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
2020-11-14 02:54:24 +08:00
(generate a slomo mp4 video based on two input images)
2020-11-13 23:28:32 +08:00
$ 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
2020-11-14 02:54:24 +08:00
(generate video_2x.mp4, you can use this script recursively to get 4X, 8X, 16X...)
2020-11-12 23:39:28 +08:00
```
2020-11-13 10:27:30 +08:00
2020-11-14 14:56:13 +08:00
We will release our training and benchmark validation code soon.
2020-11-13 11:16:57 +08:00
## Citation
2020-11-13 23:28:32 +08:00
2020-11-13 10:27:30 +08:00
```
@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
2020-11-13 11:16:57 +08:00
Optical Flow:
2020-11-13 17:42:43 +08:00
[ARFlow](https://github.com/lliuz/ARFlow) [pytorch-liteflownet](https://github.com/sniklaus/pytorch-liteflownet) [RAFT](https://github.com/princeton-vl/RAFT)
2020-11-13 11:16:57 +08:00
Video Interpolation:
[DAIN](https://github.com/baowenbo/DAIN) [CAIN](https://github.com/myungsub/CAIN) [AdaCoF-pytorch](https://github.com/HyeongminLEE/AdaCoF-pytorch)