2023-12-15 15:07:34 +08:00
# Practical-RIFE
2021-12-16 16:59:02 +08:00
**[V4.0 Promotional Video (宣传视频) ](https://www.bilibili.com/video/BV1J3411t7qT?p=1&share_medium=iphone&share_plat=ios&share_session_id=7AE3DA72-D05C-43A0-9838-E2A80885BD4E&share_source=QQ&share_tag=s_i×tamp=1639643780&unique_k=rjqO0EK )**
2021-12-10 12:33:37 +08:00
2023-12-04 10:50:06 +08:00
2023.10-12 - We recently release new v4.7-4.13 models! 🎉
2023-10-23 15:23:12 +08:00
2023-12-04 10:50:06 +08:00
<img width="710" alt="image" src="https://github.com/hzwer/Practical-RIFE/assets/10103856/e692b6f0-ff1a-45f7-8cd7-2bd3e6919ec5">
2023-09-25 16:32:45 +08:00
2023-11-01 11:16:00 +08:00
This project is based on [RIFE ](https://github.com/hzwer/arXiv2020-RIFE ) and [SAFA ](https://github.com/megvii-research/WACV2024-SAFA ). We aim to make them more practical for users by adding various features and designing new models. Because improving the PSNR index is not compatible with subjective effects, we hope this part of work and our academic research are independent of each other. To reduce development pressure, this project is for engineers and developers. For common users, we recommend the following softwares:
2021-12-16 16:59:02 +08:00
2022-09-16 02:08:26 +08:00
** [SVFI (中文) ](https://github.com/YiWeiHuang-stack/Squirrel-Video-Frame-Interpolation ) | [RIFE-App ](https://grisk.itch.io/rife-app ) | [FlowFrames ](https://nmkd.itch.io/flowframes ) | [Drop frame fixer and FPS converter ](https://github.com/may-son/RIFE-FixDropFrames-and-ConvertFPS )**
2021-06-16 13:38:55 +08:00
2023-10-27 17:03:36 +08:00
Thanks to [SVFI team ](https://github.com/Justin62628/Squirrel-RIFE ) to support model testing on Animation.
2021-06-16 13:46:52 +08:00
2023-11-27 15:56:04 +08:00
## Video Enhancement
2023-12-15 15:07:18 +08:00
<img width="710" alt="image" src="https://github.com/hzwer/Practical-RIFE/assets/10103856/d2df923b-5691-406f-987c-462f5e0af740">
2023-12-18 11:42:32 +08:00
We are developing a practical model of [SAFA ](https://github.com/megvii-research/WACV2024-SAFA ). Welcome to check its [demo ](https://www.youtube.com/watch?v=gq7CVj2QyfI ) ([BiliBili ](https://www.bilibili.com/video/BV1NN4117715/ )) and provide advice.
2023-11-28 15:46:53 +08:00
2023-12-18 11:42:32 +08:00
v0.4 - 2023.12.18 | [Google Drive ](https://drive.google.com/file/d/1s95iCoiTUsQq7pZPWeSKtQSJAWeA-yOr/view?usp=share_link ) || v0.3 - 2023.12.15 | [Google Drive ](https://drive.google.com/file/d/16diYU99xRJmTgKAEzfjppwFWTRFxVitb/view?usp=sharing )
2023-12-15 15:08:39 +08:00
2023-12-11 18:31:55 +08:00
v0.2 - 2023.12.11 | [Google Drive ](https://drive.google.com/file/d/1IyJvz9qxCR59BW4q5PzOb6y3JRLnf9QE/view?usp=share_link ) || v0.1 - 2023.11.27 | [Google Drive ](https://drive.google.com/file/d/1Z4VcVxJ67zDYtddPPe2pSwMJId0KNV_I/view?usp=sharing )
2023-11-28 15:46:53 +08:00
```
2023-11-28 16:00:27 +08:00
python3 inference_video_enhance.py --video=demo.mp4
2023-11-28 15:46:53 +08:00
```
2023-11-01 11:14:57 +08:00
## Frame Interpolation
2021-06-16 14:22:32 +08:00
### Model List
2022-09-05 11:31:49 +08:00
The content of these links is under the same MIT license as this project.
2023-12-05 01:28:59 +08:00
4.13.1 - 2023.12.05 | [Google Drive ](https://drive.google.com/file/d/1mj9lH6Be7ztYtHAr1xUUGT3hRtWJBy_5/view?usp=sharing ) | [百度网盘 ](https://pan.baidu.com/s/1e0I-ERSYQThANP7BQmz3Vw?pwd=e2h8 )
2022-03-23 11:16:39 +08:00
2023-11-27 15:53:55 +08:00
4.13.**lite** - 2023.11.27 | [Google Drive ](https://drive.google.com/file/d/1l3lH9QxQQeZVWtBpdB22jgJ-0kmGvXra/view?usp=sharing ) | [百度网盘 ](https://pan.baidu.com/s/12arDG3wAG9soGBmzUkkbeQ?pwd=2fy8 ) || v4.12.2 - 2023.11.13 | [Google Drive ](https://drive.google.com/file/d/1ZHrOBL217ItwdpUBcBtRE3XBD-yy-g2S/view?usp=share_link ) | [百度网盘 ](https://pan.baidu.com/s/1zyAw-qZJsIsAyFOIZKumYQ?pwd=gwij )
2023-11-16 23:29:17 +08:00
v4.11.1 - 2023.11.11 | [Google Drive ](https://drive.google.com/file/d/1Dwbp4qAeDVONPz2a10aC2a7-awD6TZvL/view?usp=share_link ) | [百度网盘 ](https://pan.baidu.com/s/1TZiZuCHaG4SKmxKrqbbBDQ?pwd=pw2i ) || v4.10.1 - 2023.11.09 [Google Drive ](https://drive.google.com/file/d/1WNot1qYBt05LUyY1O9Uwwv5_K8U6t8_x/view?usp=sharing ) | [百度网盘 ](https://pan.baidu.com/s/19niopL-Qwu2qOydIB1pEBg?pwd=88kv )
2023-11-09 14:06:53 +08:00
2023-11-16 11:22:10 +08:00
v4.9.2 - 2023.11.01 | [Google Drive ](https://drive.google.com/file/d/1UssCvbL8N-ty0xIKM5G5ZTEgp9o4w3hp/view?usp=sharing ) | [百度网盘 ](https://pan.baidu.com/s/18cbx3EP4HWgSa1vkcXvvyw?pwd=swr9 ) || v4.8.1 - 2023.10.23 | [Google Drive ](https://drive.google.com/file/d/1wZa3SyegLPUwBQWmoDLM0MumWd2-ii63/view?usp=sharing ) | [百度网盘 ](https://pan.baidu.com/s/1hq-O3QY5OVzLHIQ90jKkyg?pwd=vhsq )
2023-10-23 15:13:07 +08:00
2023-11-16 11:22:10 +08:00
v4.7.1 - 2023.9.25 | [Google Drive ](https://drive.google.com/file/d/1s2zMMIJrUAFLexktm1rWNhlIyOYJ3_ju/view?usp=sharing ) | [百度网盘,密码:m38k ](https://pan.baidu.com/s/1Mc7bvkVWMUG9F0Gqb_Vcpg?pwd=848u ) || v4.6 - 2022.9.26 | [Google Drive ](https://drive.google.com/file/d/1EAbsfY7mjnXNa6RAsATj2ImAEqmHTjbE/view?usp=sharing ) | [百度网盘,密码:gtkf ](https://pan.baidu.com/s/1Oc1enSD7kGnoQda2MdPYsw )
2022-09-26 16:44:47 +08:00
2022-08-17 17:16:24 +08:00
v4.3 - 2022.8.17 | [Google Drive ](https://drive.google.com/file/d/1xrNofTGMHdt9sQv7-EOG0EChl8hZW_cU/view?usp=sharing ) | [百度网盘,密码:q83a ](https://pan.baidu.com/s/12AUAeZLZf5E1_Zx6WkS3xw?pwd=q83a ) || v4.2 - 2022.8.10 | [Google Drive ](https://drive.google.com/file/d/1JpDAJPrtRJcrOZMMlvEJJ8MUanAkA-99/view?usp=sharing ) | [百度网盘,密码:y3ad ](https://pan.baidu.com/s/1Io4Z_QUaBv-O7dYERqQAPw?pwd=y3ad )
2021-12-06 12:09:27 +08:00
2022-08-17 17:26:33 +08:00
v3.8 - 2021.6.17 | [Google Drive ](https://drive.google.com/file/d/1O5KfS3KzZCY3imeCr2LCsntLhutKuAqj/view?usp=sharing ) | [百度网盘, 密码:kxr3 ](https://pan.baidu.com/s/1X-jpWBZWe-IQBoNAsxo2mA ) || v3.1 - 2021.5.17 | [Google Drive ](https://drive.google.com/file/d/1xn4R3TQyFhtMXN2pa3lRB8cd4E1zckQe/view?usp=sharing ) | [百度网盘, 密码:64bz ](https://pan.baidu.com/s/1W4p_Ni04HLI_jTy45sVodA )
2021-06-17 11:38:16 +08:00
2023-11-18 14:00:04 +08:00
[More Older Version ](https://github.com/megvii-research/ECCV2022-RIFE/issues/41 )
2023-07-19 23:06:46 +08:00
2021-06-16 13:56:59 +08:00
### Installation
```
2021-06-17 11:20:35 +08:00
git clone git@github.com:hzwer/Practical-RIFE.git
cd Practical-RIFE
2021-06-16 13:56:59 +08:00
pip3 install -r requirements.txt
```
2021-06-17 11:20:35 +08:00
Download a model from the model list and put *.py and flownet.pkl on train_log/
2021-06-16 13:56:59 +08:00
### Run
2021-06-16 14:35:56 +08:00
You can use our [demo video ](https://drive.google.com/file/d/1i3xlKb7ax7Y70khcTcuePi6E7crO_dFc/view?usp=sharing ) or your video.
2021-06-16 13:56:59 +08:00
```
2021-11-23 18:03:20 +08:00
python3 inference_video.py --multi=2 --video=video.mp4
2021-06-16 13:56:59 +08:00
```
(generate video_2X_xxfps.mp4)
```
2021-11-23 18:03:20 +08:00
python3 inference_video.py --multi=4 --video=video.mp4
2021-06-16 13:56:59 +08:00
```
(for 4X interpolation)
```
2021-11-23 18:03:20 +08:00
python3 inference_video.py --multi=2 --video=video.mp4 --scale=0.5
2021-06-16 13:56:59 +08:00
```
2021-06-16 14:35:56 +08:00
(If your video has high resolution, such as 4K, we recommend set --scale=0.5 (default 1.0))
2021-06-16 13:56:59 +08:00
```
2021-11-23 18:03:20 +08:00
python3 inference_video.py ---multi=4 --img=input/
2021-06-16 13:56:59 +08:00
```
(to read video from pngs, like input/0.png ... input/612.png, ensure that the png names are numbers)
```
2021-11-23 18:03:20 +08:00
python3 inference_video.py --multi=3 --video=video.mp4 --fps=60
2021-06-16 13:56:59 +08:00
```
(add slomo effect, the audio will be removed)
2023-11-01 11:14:57 +08:00
### Model training
2023-11-16 16:01:07 +08:00
The whole repo can be downloaded from [v4.0 ](https://drive.google.com/file/d/1zoSz7b8c6kUsnd4gYZ_6TrKxa7ghHJWW/view?usp=sharing ), [v4.12 ](https://drive.google.com/file/d/1IHB35zhO4rr-JSMnpRvHhU9U65Z4giWv/view?usp=sharing ). However, we currently do not have the time to organize it well, it is for reference only.
2021-06-17 11:41:32 +08:00
2023-11-01 11:14:57 +08:00
### To-do List
2021-06-17 11:41:32 +08:00
Multi-frame input of the model
2021-11-23 14:11:30 +08:00
Frame interpolation at any time location (Done)
2021-06-17 11:41:32 +08:00
Eliminate artifacts as much as possible
Make the model applicable under any resolution input
Provide models with lower calculation consumption
2021-06-16 13:50:43 +08:00
## Citation
```
2022-08-10 22:45:01 +08:00
@inproceedings{huang2022rife,
title={Real-Time Intermediate Flow Estimation for Video Frame Interpolation},
2021-06-16 13:50:43 +08:00
author={Huang, Zhewei and Zhang, Tianyuan and Heng, Wen and Shi, Boxin and Zhou, Shuchang},
2022-08-10 22:45:01 +08:00
booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
year={2022}
2021-06-16 13:50:43 +08:00
}
```
2023-10-27 17:03:36 +08:00
```
@inproceedings{huang2024safa,
title={Scale-Adaptive Feature Aggregation for Efficient Space-Time Video Super-Resolution},
author={Huang, Zhewei and Huang, Ailin and Hu, Xiaotao and Hu, Chen and Xu, Jun and Zhou, Shuchang},
booktitle={Winter Conference on Applications of Computer Vision (WACV)},
year={2024}
}
```
2021-06-16 13:50:43 +08:00
## Reference
Optical Flow:
[ARFlow ](https://github.com/lliuz/ARFlow ) [pytorch-liteflownet ](https://github.com/sniklaus/pytorch-liteflownet ) [RAFT ](https://github.com/princeton-vl/RAFT ) [pytorch-PWCNet ](https://github.com/sniklaus/pytorch-pwc )
Video Interpolation:
[DVF ](https://github.com/lxx1991/pytorch-voxel-flow ) [TOflow ](https://github.com/Coldog2333/pytoflow ) [SepConv ](https://github.com/sniklaus/sepconv-slomo ) [DAIN ](https://github.com/baowenbo/DAIN ) [CAIN ](https://github.com/myungsub/CAIN ) [MEMC-Net ](https://github.com/baowenbo/MEMC-Net ) [SoftSplat ](https://github.com/sniklaus/softmax-splatting ) [BMBC ](https://github.com/JunHeum/BMBC ) [EDSC ](https://github.com/Xianhang/EDSC-pytorch ) [EQVI ](https://github.com/lyh-18/EQVI ) [RIFE ](https://github.com/hzwer/arXiv2020-RIFE )