Home

Awesome

Leveraging Inpainting for Single-Image Shadow Removal, Accepted by ICCV2023

In this work, we find that pretraining shadow removal networks on the image inpainting dataset can reduce the shadow remnants significantly: a naive encoder-decoder network gets competitive restoration quality w.r.t. the state-of-the-art methods via only 10% shadow & shadow-free image pairs. After analyzing networks with/without inpainting pretraining via the information stored in the weight (IIW), we find that inpainting pretraining improves restoration quality in non-shadow regions and enhances the generalization ability of networks significantly. Additionally, shadow removal fine-tuning enables networks to fill in the details of shadow regions. Inspired by these observations we formulate shadow removal as an adaptive fusion task that takes advantage of both shadow removal and image inpainting. The extensive experiments show that our method empowered with inpainting outperforms all state-of-the-art methods.[ArXiv] <br>

<p align="center"> <a href = "https://#"> <img src="./images/colab.svg"> </a> <br> Try our method in Google Colab </p>

Framework

Prerequisites

Dataset

Pretrained models

De-shadowed results

Training

Testing

  1. Downloaded the "ISTD+.pth" and put that under ./shadow_removal/checkpoints.
  2. Update "MODEL_LOAD: ISTD+.pth" in ./shadow_removal/checkpoints/config.yml.
  3. Update the test dataset path in ./shadow_removal/checkpoints/config.yml.
    python ./shadow_removal/test.py 
    
  1. The RMSE results reported in the paper are calculated by the <a href='https://drive.google.com/file/d/1SAMqLy3dSONPgeC5ZQskPoeq60FEx9Vk/view'>matlab script</a>. Our evaluation code will print the metrics calculated by python code and save the de-shadowed results which will be used by the matlab script.
  2. PSNR, SSIM, and LPIPS
    python ./shadow_removal/Evaluation.py 
    

Results

Bibtex

@article{li2023leveraging,
  title={Leveraging Inpainting for Single-Image Shadow Removal},
  author={Li, Xiaoguang and Guo, Qing and Abdelfattah, Rabab and Lin, Di and Feng, Wei and Tsang, Ivor and Wang, Song},
  journal={arXiv preprint arXiv:2302.05361},
  year={2023}
}