duxiangcheng / G2R-ShadowNet

CVPR2021 From Shadow Generation to Shadow Removal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

G2R-ShadowNet

From Shadow Generation to Shadow Removal.

Dependencies

This code uses the following libraries

  • python 3.7+
  • pytorch 1.1+ & tochvision
  • scikit-image

Training code and data

Generate the training data using the original ISTD dataset and the code gettraindata.m

or download the training data from: GoogleDrive: ISTD | BaiduNetdisk: ISTD (Access code: 1111)

Your ~/PAISTD8/ folder should look like this

PAISTD8
├── train/
    ├── train_A/
    │   └── 90-1.png
    │   └── ...
    ├── train_B/
    │   └── ...
    └── ...

Testing masks produced by BDRAR

GoogleDrive: ISTD

BaiduNetdisk: ISTD (Access code: 1111)

Train and test on the adjusted ISTD dataset

Train

  1. Set the path of the dataset in train.py
  2. Run train.py

Test

  1. Set the paths of the dataset and saved models (netG_1.pth) and (netG_2.pth) in test.py
  2. Run test.py

Evaluate

  1. Set the paths of the shadow removal results and the dataset in evaluate.m
  2. Run evaluate.m

The Best Models on ISTD

GoogleDrive: ISTD

BaiduNetdisk: ISTD (Access code: 1111)

Results of G2R-ShadowNet on ISTD

GoogleDrive: ISTD

BaiduNetdisk: ISTD (Access code: 1111)

Results of G2R-ShadowNet-Sup. on ISTD

GoogleDrive: ISTD

BaiduNetdisk: ISTD (Access code: 1111)

ISTD Results (size: 480x640)

Method Shadow Region Non-shadow Region All
Le & Samaras (ECCV20) 11.3 3.7 4.8
G2R-ShadowNet (Ours) 9.6 3.8 4.7

Results in shadow and non-shadow regions are computed on each image first and then compute the average of all images in terms of RMSE.

Acknowledgments

Code is implemented based on Mask-ShadowGAN and LG-ShadowNet.

All codes will be released to public soon.

@inproceedings{liu2021from,
  title={From Shadow Generation to Shadow Removal},
  author={Liu, Zhihao and Yin, Hui and Wu, Xinyi and Wu, Zhenyao and Mi, Yang and Wang, Song},
  booktitle={CVPR},
  year={2021}
}

About

CVPR2021 From Shadow Generation to Shadow Removal


Languages

Language:Python 87.1%Language:MATLAB 12.9%