All Projects → Tengfei-Wang → Implicit-Internal-Video-Inpainting

Tengfei-Wang / Implicit-Internal-Video-Inpainting

Licence: other
[ICCV 2021]: IIVI: Internal Video Inpainting by Implicit Long-range Propagation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Implicit-Internal-Video-Inpainting

Video Object Removal
Just draw a bounding box and you can remove the object you want to remove.
Stars: ✭ 2,283 (+1101.58%)
Mutual labels:  image-inpainting, video-inpainting, object-removal
Depth-Guided-Inpainting
Code for ECCV 2020 "DVI: Depth Guided Video Inpainting for Autonomous Driving"
Stars: ✭ 50 (-73.68%)
Mutual labels:  image-inpainting, video-inpainting, object-removal
Auto Editor
Auto-Editor: Effort free video editing!
Stars: ✭ 382 (+101.05%)
Mutual labels:  video-processing, video-editing
Transcoder
🎞 Hardware-accelerated video transcoding using Android MediaCodec APIs. Supports cropping, concatenation, clipping, audio processing, video speed and much more.
Stars: ✭ 404 (+112.63%)
Mutual labels:  video-processing, video-editing
Pyjumpcutterv2
carykh's but with improvements and a GUI!
Stars: ✭ 25 (-86.84%)
Mutual labels:  video-processing, video-editing
Libopenshot
OpenShot Video Library (libopenshot) is a free, open-source project dedicated to delivering high quality video editing, animation, and playback solutions to the world. API currently supports C++, Python, and Ruby.
Stars: ✭ 601 (+216.32%)
Mutual labels:  video-processing, video-editing
Vectorhub
Vector Hub - Library for easy discovery, and consumption of State-of-the-art models to turn data into vectors. (text2vec, image2vec, video2vec, graph2vec, bert, inception, etc)
Stars: ✭ 317 (+66.84%)
Mutual labels:  video-processing, deeplearning
Mp4composer Android
This library generate an Mp4 movie using Android MediaCodec API and apply filter, scale, trim, transcode, crop, timeScale, mute and rotate Mp4.
Stars: ✭ 674 (+254.74%)
Mutual labels:  video-processing, video-editing
Metalvideoprocess
MetalVideoProcess is a High-Performance video effects processing framework. It's base on GPUImage3 Metal, support asynchronous and multithread processing.
Stars: ✭ 52 (-72.63%)
Mutual labels:  video-processing, video-editing
Webmgenerator
UI and Automation to cut, filter and join high quality webms, mp4s or gifs.
Stars: ✭ 103 (-45.79%)
Mutual labels:  video-processing, video-editing
Optivideoeditor For Android
Native Video editor : Video trim, Audio, Video merge, Slow and fast motion, Text and image, etc...
Stars: ✭ 209 (+10%)
Mutual labels:  video-processing, video-editing
video-audio-tools
To process/edit video and audio with Python+FFmpeg. [简单实用] 基于Python+FFmpeg的视频和音频的处理/剪辑。
Stars: ✭ 164 (-13.68%)
Mutual labels:  video-processing, video-editing
Moviepy
Video editing with Python
Stars: ✭ 8,795 (+4528.95%)
Mutual labels:  video-processing, video-editing
Cinema
a lightweight video editing library for go (trimming, resizing, cropping, and more!)
Stars: ✭ 213 (+12.11%)
Mutual labels:  video-processing, video-editing
RFDA-PyTorch
Official Code for 'Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction' - ACM Multimedia2021 (ACMMM2021) Accepted Paper Task: Video Quality Enhancement / Video Compression Artifact Reduction
Stars: ✭ 44 (-76.84%)
Mutual labels:  video-processing, deeplearning
query completion
Personalized Query Completion
Stars: ✭ 24 (-87.37%)
Mutual labels:  deeplearning
Color-Image-Inpainting
Image inpainting based on OMP and KSVD algorithm
Stars: ✭ 66 (-65.26%)
Mutual labels:  image-inpainting
SSffmpegVideoOperation
This is a library of FFmpeg for android... 📸 🎞 🚑
Stars: ✭ 261 (+37.37%)
Mutual labels:  video-processing
FastPose
pytorch realtime multi person keypoint estimation
Stars: ✭ 36 (-81.05%)
Mutual labels:  deeplearning
numpy-neuralnet-exercise
Implementation of key concepts of neuralnetwork via numpy
Stars: ✭ 49 (-74.21%)
Mutual labels:  deeplearning

Implicit Internal Video Inpainting

Implementation for our ICCV2021 paper: Internal Video Inpainting by Implicit Long-range Propagation

paper | project website | 4K data | demo video

Our results on 70 DAVIS videos (including failure cases) can be found here for your reference :)
If you need the PNG version of our uncompressed results, please contact the authors.

Introduction

Want to remove objects from a video without days of training and thousands of training videos? Try our simple but effective internal video inpainting method. The inpainting process is zero-shot and implicit, which does not need any pretraining on large datasets or optical-flow estimation. We further extend the proposed method to more challenging tasks: video object removal with limited annotated masks, and inpainting on ultra high-resolution videos (e.g., 4K videos).

Setup

Installation

git clone https://github.com/Tengfei-Wang/Implicit-Internal-Video-Inpainting.git
cd Implicit-Internal-Video-Inpainting

Environment

This code is based on tensorflow 2.x (tested on tensorflow 2.0, 2.2, 2.4).

The environment can be simply set up by Anaconda:

conda create -n IIVI python=3.7
conda activate IIVI
conda install tensorflow-gpu tensorboard
pip install pyaml 
pip install opencv-python
pip install tensorflow-addons

Or, you can also set up the environment from the provided environment.yml:

conda env create -f environment.yml
conda activate IIVI

Usage

Quick Start

We provide an example sequence 'bmx-trees' in ./inputs/ . To try our method:

python train.py

The default iterations is set to 50,000 in config/train.yml, and the internal learning takes ~4 hours with a single GPU. During the learning process, you can use tensorboard to check the results by:

tensorboard --logdir ./exp/logs

After the training, the final results can be saved in ./exp/results/ by:

python test.py

You can also modify 'model_restore' in config/test.yml to save results with different checkpoints.

Try Your Own Data

Data preprocess

Before training, we advise to dilate the object masks first to exclude some edge pixels. Otherwise, the imperfectly-annotated masks would lead to artifacts in the object removal task.

You can generate and preprocess the masks by this script:

python scripts/preprocess_mask.py --annotation_path inputs/annotations/bmx-trees

Basic training

Modify the config/train.yml, which indicates the video path, log path, and training iterations,etc.. The training iterations depends on the video length, and it typically takes 30,000 ~ 80,000 iterations for convergence for 100-frame videos (one a single GPU). By default, we only use reconstruction loss for training, and it works well for most cases.

python train.py

Improve the sharpness and consistency

For some hard videos, the former training may not produce a pleasing result. You can fine-tune the trained model with another losses. To this end, modify the 'model_restore' in config/test.yml to the checkpoint path of basic training. Also set ambiguity_loss or stabilization_loss to True. Then fine-tune the basic checkpoint for 20,000-40,000 iterations.

python train.py

Inference

Modify the ./config/test.yml, which indicates the video path, log path, and save path.

python test.py

Distributed training

To accelerate the training process, multi-GPUs can be used.
To utilize multi-GPUs for training, modify the ./config/train.yml accordingly. For example, GPU_ID: '0,1', batch_size: 5, lr: 0.0002.

python train_dist.py

Note that we have only tested the distributed training code on tensorflow 2.0. (it may not work for tf 2.4).

Mask Propagation from A Single Frame

When you only annotate the object mask of one frame (or few frames), our method can propagate it to other frames automatically.

Modify ./config/train_mask.yml. We typically set the training iterations to 4,000 ~ 20,000, and the learning rate to 1e-5 ~ 1e-4.

python train_mask.py

After training, modify ./config/test_mask.yml, and then:

python test_mask.py

High-resolution Video Inpainting

Our 4K videos and mask annotations can be downloaded in 4K data.

Citation

If you find this work useful for your research, please cite:

@inproceedings{ouyang2021video,
  title={Internal Video Inpainting by Implicit Long-range Propagation},
  author={Ouyang, Hao and Wang, Tengfei and Chen, Qifeng},
  booktitle={International Conference on Computer Vision (ICCV) },
  year={2021}
} 

If you are also interested in the image inpainting or internal learning, this paper can be also helpful :)

@inproceedings{wang2021image,
  title={Image Inpainting with External-internal Learning and Monochromic Bottleneck},
  author={Wang, Tengfei and Ouyang, Hao and Chen, Qifeng},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={5120--5129},
  year={2021}
}

Contact

Please send emails to Hao Ouyang or Tengfei Wang if there is any question

Acknowledgement

We thank the authors of DeepFill for sharing their codes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].