Awesome
RIS-GAN
This repository contains TensorFlow code for the paper titled "RIS-GAN: Explore Residual and Illumination with Generative Adversarial Networks for Shadow Removal" pdf (http://www.chengjianglong.com/publications/RISGAN_AAAI.pdf).
##RIS-GAN Architecture
Attached below is the architecture diagram of RIS-GAN as given in the paper.
Notes:
- The GAN component is dervied from paper "Single Image Haze Removal using a Generative Adversarial Network".
- This RIS-GAN can be used for any application, and is not limited to Shadow removal.
Requirements:
- TensorFlow (version 1.4+)
- Matplotlib
- Numpy
- Scikit-Image
Instructions:
-
We use the pretrained VGG-19 on the ImageNet dataset to calculate Perceptual loss. We used the weights provided by machrisaa's implementation. Download the weights from this link and include it in this repository.
-
Download the dataset.
- We used the ISTD dataset for training. The shadow images and corresponding shadow-free images will be placed in directories
A
andB
respectively.
- In case you want to use your own dataset, follow these instructions. If not, skip this step.
- Create two directories
A
andB
in this repository. - Place the input images into directory
A
and target images into directoryB
. - Ensure that an input and target image pair has the same name, otherwise the program will throw an error (For instance, if
1.jpg
is present inA
it must also be present inB
).
- Train the model by using the following code.
python main.py --A_dir A --B_dir B --mode train
The file main.py
supports a lot of parameters, which are given a default value. You can set a new value to suit your needs.
- Test by using the follwing code.
python main.py --A_dir shadow --B_dir result --mode inference
##Sample results Attached below are some shadow removal results from the test set.
Citation
If you use the code in your own research, please cite:
@InProceedings{Zhang:AAA2020,
title = {RIS-GAN: Explore Residual and Illumination with Generative Adversarial Networks for Shadow Removal},
author = {Zhang, Ling and Long, Chengjiang and Zhang, Xiaolong and Xiao, Chunxia},
booktitle = {AAAI Conference on Artificial Intelligence (AAAI)},
year = {2020}
}
Depending on the setup you use, consider also citing paper "Single Image Haze Removal using a Generative Adversarial Network".