All Projects → vinthony → Ghost Free Shadow Removal

vinthony / Ghost Free Shadow Removal

[AAAI 2020] Towards Ghost-free Shadow Removal via Dual Hierarchical Aggregation Network and Shadow Matting GAN

Projects that are alternatives of or similar to Ghost Free Shadow Removal

Solt
Streaming over lightweight data transformations
Stars: ✭ 249 (+87.22%)
Mutual labels:  jupyter-notebook, data-augmentation
Deltapy
DeltaPy - Tabular Data Augmentation (by @firmai)
Stars: ✭ 344 (+158.65%)
Mutual labels:  jupyter-notebook, data-augmentation
Mixup Generator
An implementation of "mixup: Beyond Empirical Risk Minimization"
Stars: ✭ 250 (+87.97%)
Mutual labels:  jupyter-notebook, data-augmentation
Copy Paste Aug
Copy-paste augmentation for segmentation and detection tasks
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook, data-augmentation
Dataaugmentationforobjectdetection
Data Augmentation For Object Detection
Stars: ✭ 812 (+510.53%)
Mutual labels:  jupyter-notebook, data-augmentation
Drq
DrQ: Data regularized Q
Stars: ✭ 268 (+101.5%)
Mutual labels:  jupyter-notebook, data-augmentation
Dab
Data Augmentation by Backtranslation (DAB) ヽ( •_-)ᕗ
Stars: ✭ 294 (+121.05%)
Mutual labels:  jupyter-notebook, data-augmentation
Amazon Forest Computer Vision
Amazon Forest Computer Vision: Satellite Image tagging code using PyTorch / Keras with lots of PyTorch tricks
Stars: ✭ 346 (+160.15%)
Mutual labels:  jupyter-notebook, data-augmentation
Pba
Efficient Learning of Augmentation Policy Schedules
Stars: ✭ 461 (+246.62%)
Mutual labels:  jupyter-notebook, data-augmentation
Mobilepose Pytorch
Light-weight Single Person Pose Estimator
Stars: ✭ 427 (+221.05%)
Mutual labels:  jupyter-notebook, data-augmentation
Veri Artirma Data Augmentation
Bu repoda veri artırma (data augmentation) ile ilgili pratik uygulamalara ulaşabilirsiniz.
Stars: ✭ 22 (-83.46%)
Mutual labels:  jupyter-notebook, data-augmentation
All Classifiers 2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 22 (-83.46%)
Mutual labels:  jupyter-notebook, data-augmentation
Dda
Differentiable Data Augmentation Library
Stars: ✭ 65 (-51.13%)
Mutual labels:  jupyter-notebook, data-augmentation
Google Colab Cloudtorrent
Colab Notebook Remote torrent client
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook
Deeplearningbook Notes
Notes on the Deep Learning book from Ian Goodfellow, Yoshua Bengio and Aaron Courville (2016)
Stars: ✭ 1,672 (+1157.14%)
Mutual labels:  jupyter-notebook
Docs
MindSpore document
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook
Team Learning Nlp
主要存储Datawhale组队学习中“自然语言处理”方向的资料。
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook
Keras Mnist Tutorial
For a mini tutorial at U of T, a tutorial on MNIST classification in Keras.
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook
Seq2seq tutorial
Code For Medium Article "How To Create Data Products That Are Magical Using Sequence-to-Sequence Models"
Stars: ✭ 132 (-0.75%)
Mutual labels:  jupyter-notebook
Attic Climate
Mirror of Apache Open Climate Workbench
Stars: ✭ 131 (-1.5%)
Mutual labels:  jupyter-notebook

Towards Ghost-free Shadow Removal

This repo contains the code and results of the AAAI 2020 paper:

Towards Ghost-free Shadow Removal via
Dual Hierarchical Aggregation Network and Shadow Matting GAN

Xiaodong Cun, Chi-Man Pun*, Cheng Shi
University of Macau

Syn. Datasets | Models | Results | Paper | Supp. | Poster | 🔥Online Demo!(Google CoLab)

We plot a result of our model with the input shown in the yellow square. From two zoomed regions, our method removes the shadow and reduces the ghost successfully.

Known Issues

#4 inconsistency between the code and Figure.2, Thanks @naoto0804

Introduction

Shadow removal is an essential task for scene understanding. Many studies consider only matching the image contents, which often causes two types of ghosts: color in-consistencies in shadow regions or artifacts on shadow boundaries. In this paper, we try to tackle these issues in two aspects. On the one hand, to carefully learn the border artifacts-free image, we propose a novel network structure named the Dual Hierarchically Aggregation Network(DHAN). It contains a series of growth dilated convolutions as the backbone without any down-samplings, and we hierarchically aggregate multi-context features for attention and prediction respectively. On the other hand, we argue that training on a limited dataset restricts the textural understanding of the network, which leads to the shadow region color in-consistencies. Currently, the largest dataset contains 2k+ shadow/shadow-free images in pairs. However, it has only 0.1k+ unique scenes since many samples share exactly the same background with different shadow positions. Thus, we design a Shadow Matting Generative Adversarial Network~(SMGAN) to synthesize realistic shadow mattings from a given shadow mask and shadow-free image. With the help of novel masks or scenes, we enhance the current datasets using synthesized shadow images. Experiments show that our DHAN can erase the shadows and produce high-quality ghost-free images. After training on the synthesized and real datasets, our network outperforms other state-of-the-art methods by a large margin.

Sample Comparsion

fig1857_5

Comparison on the shadow removal datasets, The first two samples are from ISTD dataset while the bottom two samples are from SRD dataset. In (d), the top two samples are from ST-CGAN and the bottom two samples are from DeShadowNet.

Resources

Other Resources

Setup

Creating the conda environments following here.

Demo

1. Local ipynb demo

  1. download the pre-trained model from above. SRD+ is recommended.
  2. download pretrained-vgg19 from MatConvNet.
  3. Uncompress pre-trained models into 'Models/' as shown in the folders.
  4. Starting a jupyter server and run the demo code following the instructions in demo.ipynb

It has been tested both in MacOS 10.15 and Ubuntu 18.04 LTS. Both CPU and GPU are supported (But running on CPU is quite slow).

2. Online google colab demo

an online shadow removal demo is hosted in Google CoLab by this url

an online shadow synthesis demo is hosted in Google CoLab by this url

3. Demo from command line (Thanks @aliericcantona)

python demo.py --model PATH_TO_PRETRAINED_MODEL --vgg_19_path PATH_TO_VGG19 --input_dir SAMPLES_DIR --result_dir RESULTS_DIR

Training

The data folders should be:

ISTD_DATA_ROOT
    * train
        - train_A # shadow image
        - train_B # shadow mask
        - train_C # shadowfree image
        - shadow_free # USR shadowfree images
        - synC # our Syn. shadow
    * test
        - test_A # shadow image
        - test_B # shadow mask
        - test_C # shadowfree image

SRD_DATA_ROOT
    * train
        - train_A # renaming the original `shadow` folder in `SRD`.
        - train_B # the extracted shadow mask by ourself.
        - train_C # renaming the original `shadow_free` folder in `SRD`.
        - shadow_free # USR shadowfree images
        - synC # our Syn. shadow
    * test
        - train_A # renaming the original `shadow` folder in `SRD`.
        - train_B # the extracted shadow mask by ourself.
        - train_C # renaming the original `shadow_free` folder in `SRD`.

1. Generating Synthesized Shadow

Downloading the ISTD from the source, download the USR dataset and unzip it into unzip it into $YOUR_DATA_ROOT/ISTD_dataset/train/. Train the GAN by:

python train_ss.py \
--task YOUR_TASK_NAME \
--data_dir $YOUR_DATA_ROOT/$ISTD_DATASET_ROOT/train/ \
--use_gpu 0 # <0 for CPU \
--is_training 1 # 0 for testing \

2. Training on the ISTD dataset

Downloading the ISTD from the source, download our synthesized dataset and unzip it into $YOUR_DATA_ROOT/ISTD_dataset/train/. Train the network by:

python train_sr.py \
--task YOUR_TASK_NAME \
--data_dir $YOUR_DATA_ROOT/$ISTD_DATASET_ROOT/train/ \
--use_gpu 1 # <0 for cpu \
--is_training 1 # 0 for testing \
--use_da 0.5 # the percentage of synthesized dataset

3. Training on SRD dataset

Download and unzip the SRD dataset from the source. Reorganizing the dataset as described above.

python train_sr.py \
--task YOUR_TASK_NAME \
--data_dir $YOUR_DATA_ROOT/$SRD_DATASET_ROOT/train/ \
--use_gpu 1 # <0 for cpu \
--is_training 1 # 0 for testing \
--use_da 0.5 # the percentage of synthesized dataset

Test

# ISTD DATASET
python train_sr.py \
--task YOUR_TASK_NAME # path to the pre-trained model [logs/YOUR_TASK_NAME] \
--data_dir $YOUR_DATA_ROOT/$ISTD_DATASET_ROOT/test/ \
--use_gpu 1 # <0 for cpu \
--is_training 0 # 0 for testing \

# SRD DATASET
python train_sr.py \
--task YOUR_TASK_NAME # path to the pre-trained model [logs/YOUR_TASK_NAME] \
--data_dir $YOUR_DATA_ROOT/$SRD_DATASET_ROOT/test/ \
--use_gpu 1 # <0 for cpu \
--is_training 0 # 0 for testing \

Acknowledgements

The author would like to thanks Nan Chen for her helpful discussion.

Part of the code is based upon FastImageProcessing and Perception Reflection Removal

Citation

If you find our work useful in your research, please consider citing:

@misc{cun2019ghostfree,
    title={Towards Ghost-free Shadow Removal via Dual Hierarchical Aggregation Network and Shadow Matting GAN},
    author={Xiaodong Cun and Chi-Man Pun and Cheng Shi},
    year={2019},
    eprint={1911.08718},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

Contact

Please contact me if there is any question (Xiaodong Cun [email protected])

Related Works

Zhang, Xuaner, Ren Ng, and Qifeng Chen. "Single Image Reflection Separation with Perceptual Losses." Proceedings of the CVPR. (2018).

Hu, Xiaowei, et al. "Mask-ShadowGAN: Learning to Remove Shadows from Unpaired Data." Proceedings of the ICCV (2019).

HitCount

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].