Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 2.73 KB

README.md

File metadata and controls

56 lines (42 loc) · 2.73 KB

MPIB: An MPI-Based Bokeh Rendering Framework for Realistic Partial Occlusion Effects (ECCV 2022)

Juewen Peng1, Jianming Zhang2 Xianrui Luo1, Hao Lu1, Ke Xian1*, Zhiguo Cao1,

1Huazhong University of Science and Technology, 2Adobe Research

This repository is the official PyTorch implementation of the ECCV 2022 paper "MPIB: An MPI-Based Bokeh Rendering Framework for Realistic Partial Occlusion Effects".

Installation

git clone https://github.com/JuewenPeng/MPIB.git
cd MPIB
pip install -r requirements.txt

Usage

Download pretrained models from Google Drive or Baidu Netdisk, and put them in the directory checkpoints. Note that we use LaMa as our inpainting model, and inpnet.pth orignates from https://github.com/saic-mdal/lama.

Run the following inference code.

python demo.py --image_path 'inputs/new_11_all-in-focus.jpg' --disp_path 'inputs/new_11_disparity.jpg' --save_dir 'outputs' --K 60 --disp_focus 207/255 --gamma 2.2
  • image_path: path of the input all-in-focus image
  • disp_path: path of the input disparity map (predicted by DPT in this example)
  • save_dir: directory to save the results
  • K: blur parameter
  • disp_focus: refocused disparity (range from 0 to 1)
  • gamma: gamma value

See demo.py for more details.

Citation

If you find our work useful in your research, please cite our paper.

@inproceedings{Peng2022MPIB,
  title = {MPIB: An MPI-Based Bokeh Rendering Framework for Realistic Partial Occlusion Effects},
  author = {Peng, Juewen and Zhang, Jianming and Luo, Xianrui and Lu, Hao and Xian, Ke and Cao, Zhiguo},
  booktitle = {The Proceedings of the European Conference on Computer Vision (ECCV)},
  year = {2022}
}