Skip to content

walton-wang929/objects-removal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

objects-removal

For more, pls refer to CVPR 2019 Paper | Project Page | YouTube | BibeTex

environment

Centos7 / CUDA9 / CUDNN7 / Python3.6

To Install python virtua environments

virtualenv --python=/usr/local/python3/bin/python3 deepflow

Install & Requirements

The code has been tested on pytorch=0.4.0 and python3.6. Please refer to requirements.txt for detailed information.

To Install python packages

pip install -r requirements.txt

To Install flownet2 modules

bash install_scripts.sh

Componets

There exist three components in this repo:

Usage:

  • To use our video inpainting tool for object removing, we recommend that the frames should be put into xxx/video_name/frames and the mask of each frame should be put into xxx/video_name/masks. And please download the resources of the demo and model weights from here. An example demo containing frames and masks has been put into the demo and running the following command will get the result:
python tools/video_inpaint.py --frame_dir ./demo/frames --MASK_ROOT ./demo/masks --image_size 512 832 --FlowNet2 --DFC --ResNet101 --Propagation 

We provide the original model weight used in our movie demo which use ResNet101 as backbone and other related weights pls download from here. Please refer to tools for detailed use and training settings.

  • To extract flow for videos:
python tools/infer_flownet2.py --frame_dir xxx/video_name/frames
  • To use the Deepfillv1-Pytorch model for image inpainting,
python tools/frame_inpaint.py --test_img xxx.png --test_mask xxx.png --image_shape 512 512

result: