Home

Awesome

perceptual-reflection-removal

Code and data for CVPR 2018 paper: Single Image Reflection Removal with Perceptual Losses

Project Website | Paper

This code is based on tensorflow. It has been tested on Ubuntu 16.04 LTS.

Our result compared against CEILNet on real images.

Setup

Core Environment Requirements

Dataset

Use our collected synthetic and real data

Both synthetic and real dataset are now available here.

Try with your own dataset

You can also try with your own dataset. For example, to generate your own synthetic dataset, prepare for two folders of images, one used for transmission layer and the other used for reflection layer. In order to use our data loader, please follow the instructions below to organize your dataset directories. Overall, we name the directory of input image with reflection blended, the ground truth transmission layer transmission_layer and the ground truth reflection layer reflection_layer.

For synthetic data, since we generate images on the fly, there is no need to have the blended subdirectory.

+-- root_training_synthetic_data<br>

+-- reflection_layer<br> +-- transmission_layer<br>

For real data, since the ground truth reflection layer is not available, there is no need to have the reflection_layer subdirectory.

+-- root_training_real_data<br>

+-- blended<br> +-- transmission_layer<br>

Training

Quick Start

(please have yous real and synthetic data paths set up correctly as described above):

python main.py --data_syn_dir your_syn_data_path --data_real_dir your_real_data_path for triaining from scratch

python main.py --continue_training --data_syn_dir your_syn_data_path --data_real_dir your_real_data_path --task your_checkpoint_path for training with existing checkpoint (checkpoint path specified by the --task argument)

Arguments

--task: the checkpoint directory path. For example, for --task experiment_1, the checkpoints (e.g. *.model) are saved inside ./experiment_1/

--data_syn_dir: root path to the images to generate synthetic data

--data_real_dir: root path to the real images

--save_model_freq: frequency to save model and the output images

--is_hyper: whether to use hypercolumn features as input, all our trained models uses hypercolumn features as input

Testing

Then, run

$ python main.py --task pre-trained --is_training 0

Acknowledgement

Part of the code is based upon FastImageProcessing

Citation

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

@inproceedings{zhang2018single,
  title = {Single Image Reflection Separation with Perceptual Losses},
  author = {Zhang, Xuaner and Ng, Ren and Chen, Qifeng}
  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
  year = {2018}
}

Contact

Please contact me if there is any question (Cecilia Zhang cecilia77@berkeley.edu)