# [CVPR 2022] Inertia-Guided Flow Completion and Style Fusion for Video Inpainting
### [[Paper](https://openaccess.thecvf.com/content/CVPR2022/papers/Zhang_Inertia-Guided_Flow_Completion_and_Style_Fusion_for_Video_Inpainting_CVPR_2022_paper.pdf)] / [[Demo](https://www.youtube.com/watch?v=dHuFDPDWkYc)] / [[Project page](https://hitachinsk.github.io/publication/2022-06-01-Inertia-Guided-Flow-Completion-and-Style-Fusion-for-Video-Inpainting)] / [[Poster](https://drive.google.com/file/d/1FoClSGCu4gZZ3VINMyWnxOxvvR3PTHTL/view?usp=sharing)] / [[Intro](https://youtu.be/vR9GQNRqob8)]
This repository contains the implementation of the following paper:
> **Inertia-Guided Flow Completion and Style Fusion for Video Inpainting**<br>
> [Kaidong Zhang](https://hitachinsk.github.io/), [Jingjing Fu](https://www.microsoft.com/en-us/research/people/jifu/) and [Dong Liu](https://faculty.ustc.edu.cn/dongeliu/)<br>
> IEEE/CVF Conference on Computer Vision and Pattern Recognition 2022 (**CVPR**), 2022<br>
## Overview
<img src="materials/pipeline_isvi.jpg" height="260px"/>
Physical objects have inertia, which resists changes in the velocity and motion direction. Inspired by this, we introduce inertia prior that optical flow, which reflects object motion in a local temporal window, keeps unchanged in the adjacent preceding or subsequent frame. We propose a flow completion network to align and aggregate flow features from the consecutive flow sequences based on the inertia prior. The corrupted flows are completed under the supervision of customized losses on reconstruction, flow smoothness, and consistent ternary census transform. The completed flows with high fidelity give rise to significant improvement on the video inpainting quality. Nevertheless, the existing flow-guided cross-frame warping methods fail to consider the lightening and sharpness variation across video frames, which leads to spatial incoherence after warping from other frames. To alleviate such problem, we propose the Adaptive Style Fusion Network (ASFN), which utilizes the style information extracted from the valid regions to guide the gradient refinement in the warped regions. Moreover, we design a data simulation pipeline to reduce the training difficulty of ASFN. Extensive experiments show the superiority of our method against the state-of-the-art methods quantitatively and qualitatively.
## Prerequisites
- Linux (We tested our codes on Ubuntu18.04)
- Anaconda
- Python 3.7.6
- Pytorch 1.6.0
To get started, first please clone the repo
```
git clone https://github.com/hitachinsk/ISVI.git
```
Then, please run the following commands:
```
conda create -n ISVI
conda activate ISVI
pip install -r requirements.txt
bash install_dependances.sh
```
## Quick start
1. Download the [pre-trained models](https://drive.google.com/file/d/1YCsyGcsaZ5yvMQjMAwLDRWfWXA0fSHel/view?usp=sharing) and the [data](https://drive.google.com/file/d/1aDhC78P0bD9GrKl9mjikyRnRomjeS22h/view?usp=sharing).
2. Put the downloaded zip files to the root directory of this project
3. Run `bash prepare_data.sh` to unzip the files
4. Run the object removal demo
```bash
cd tool
python video_inpainting.py --path xxx \
--path_mask xxx \
--outroot xxx
```
If everythings works, you will find a `result.mp4` file in xxx. And the video should be like:
## License
This work is licensed under MIT license. See the [LICENSE](LICENSE) for details.
## Citation
If our work inspires your research or some part of the codes are useful for your work, please cite our paper:
```bibtex
@InProceedings{Zhang_2022_CVPR,
author = {Zhang, Kaidong and Fu, Jingjing and Liu, Dong},
title = {Inertia-Guided Flow Completion and Style Fusion for Video Inpainting},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {5982-5991}
}
```
Our other video inpainting paper [FGT](https://github.com/hitachinsk/FGT) and [FGT++](https://arxiv.org/abs/2301.10048) (The journal extension of FGT.)
```bibtex
@inproceedings{zhang2022flow,
title={Flow-Guided Transformer for Video Inpainting},
author={Zhang, Kaidong and Fu, Jingjing and Liu, Dong},
booktitle={European Conference on Computer Vision},
pages={74--90},
year={2022},
organization={Springer}
}
```
```bibtex
@misc{https://doi.org/10.48550/arxiv.2301.10048,
doi = {10.48550/ARXIV.2301.10048},
url = {https://arxiv.org/abs/2301.10048},
author = {Zhang, Kaidong and Peng, Jialun and Fu, Jingjing and Liu, Dong},
keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Exploiting Optical Flow Guidance for Transformer-Based Video Inpainting},
publisher = {arXiv},
year = {2023},
copyright = {arXiv.org perpetual, non-exclusive license}
}
```
## Contact
If you have any questions, please contact us via
- richu@mail.ustc.edu.cn
## Acknowledgement
Some parts of this repo are based on [FGVC](https://github.com/vt-vl-lab/FGVC) and [flow forward warp package](https://github.com/lizhihao6/Forward-Warp). And we adopt [RAFT](https://github.com/princeton-vl/RAFT) for flow estimation.
没有合适的资源?快使用搜索试试~ 我知道了~
[CVPR2022]视频修复的惯性引导流完成和风格融合.zip
共57个文件
py:45个
sh:2个
txt:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 148 浏览量
2023-03-22
21:48:30
上传
评论
收藏 554KB ZIP 举报
温馨提示
[CVPR2022]视频修复的惯性引导流完成和风格融合
资源推荐
资源详情
资源评论
收起资源包目录
[CVPR2022]视频修复的惯性引导流完成和风格融合.zip (57个子文件)
ISVI-main
materials
pipeline_isvi.pdf 261KB
pipeline_isvi.jpg 361KB
IGFC
models
__init__.py 0B
BaseNetwork.py 2KB
utils
reconstructionLayers.py 5KB
__init__.py 0B
network_blocks_2d.py 7KB
model.py 10KB
tool
spatial_inpaint.py 731B
video_inpaint.py 25KB
flow_extract.py 6KB
configs
object_removal.yaml 154B
utils
__init__.py 0B
region_fill.py 5KB
Poisson_blend.py 10KB
Poisson_blend_img.py 11KB
common_utils.py 23KB
frame_inpaint.py 5KB
models
__init__.py 38B
DeepFill_Models
__init__.py 0B
DeepFill.py 3KB
util.py 0B
ops.py 16KB
get_flowNN_gradient.py 25KB
ASFN
models
__init__.py 0B
BaseNetwork.py 2KB
utils
reconstructionLayers.py 6KB
__init__.py 0B
network_blocks_2d.py 7KB
model.py 9KB
LICENSE 1KB
prepare_data.sh 90B
RAFT
__init__.py 54B
extractor.py 9KB
corr.py 4KB
utils
utils.py 2KB
__init__.py 71B
flow_viz.py 7KB
frame_utils.py 4KB
augmentor.py 9KB
raft.py 5KB
datasets.py 9KB
demo.py 2KB
update.py 5KB
requirements.txt 217B
.gitignore 2KB
README.md 5KB
install_dependances.sh 330B
forward_warp
setup.py 200B
Forward_Warp
__init__.py 38B
forward_warp.py 2KB
python
__init__.py 52B
forward_warp_python.py 5KB
cuda
setup.py 369B
forward_warp_cuda.cpp 2KB
forward_warp.h 591B
forward_warp_cuda_kernel.cu 7KB
共 57 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功