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".
git clone https://github.com/JuewenPeng/MPIB.git
cd MPIB
pip install -r requirements.txt
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 imagedisp_path: path of the input disparity map (predicted by DPT in this example)save_dir: directory to save the resultsK: blur parameterdisp_focus: refocused disparity (range from 0 to 1)gamma: gamma value
See demo.py for more details.
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}
}
