tingtianli / RM2S

Codes for the paper "Single-Image Reflection Removal via a Two-Stage Background Recovery Process"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single-Image Reflection Removal via a Two-Stage Background Recovery Process

Codes for the paper "Single-Image Reflection Removal via a Two-Stage Background Recovery Process"

[paper] [code] cover

Codes are implemented on pytorch>=0.2.1

How to use

Training:

  • Training process uses images from VOC2012 for reflection image simulation.
  • The network for the first stage process:
python train_1st_stage.py --imgs_dir your_voc12_path/VOC2012/JPEGImages/
  • The network for the 2nd stage process:
python train_2nd_stage.py --imgs_dir your_voc12_path/VOC2012/JPEGImages/

Trained models will be saved in the folder ./model_para

Testing:

  • A single image demo:
python one_img_demo.py --img_dir one_image_path(e.g. imgs/1.png) --net_ini_pkl path_to_trained_models/Net_1st_stage.pkl --netG_img_pkl path_to_trained_models/Net_2nd_stage.pkl
python benchmark_imgs_process.py --bechmark_dir SIR2_dataset_path --net_ini_pkl path_to_trained_models/Net_1st_stage.pkl --netG_img_pkl path_to_trained_models/Net_2nd_stage.pkl
  • Pre-trained models are provided
  • (K-means threshold coeficents 0.5 and 0.5 can show better perceptual performance. But 0.2 and 0.8 can give better background fidelity)

Citation

@Article{li2019rm2s,
  author    = {Li, Tingtian and Lun, Daniel P.K.},
  title     = {Single-Image Reflection Removal via a Two-Stage Background Recovery Process},
  journal   = {IEEE Signal Processing Letters},
  year      = {2019},
}

About

Codes for the paper "Single-Image Reflection Removal via a Two-Stage Background Recovery Process"


Languages

Language:Python 100.0%