Skip to content

This is the official PyTorch implementation of ShadowRefiner. Our method is winner of Perceptual Track and achieves the second-best performance for Fidelity Track in NTIRE 2024 Shadow Removal Challenge (CVPR 2024 Workshop)

License

Notifications You must be signed in to change notification settings

IgorAherne/Shadow_R

 
 

Repository files navigation

Adjustment to the original repository, which allows to run it on weaker cards.
Uses chunking/patching.

Currently, original repo installation steps will result in wrong dependencies.
So instead, install like this: pip install --upgrade-strategy only-if-needed -r requirements.txt

Or you can download the full setup from here https://github.com/IgorAherne/Shadow_R/releases/tag/latest
This way you won't need to run any pip installs.

If you need neural nets, get them from google drive of the original repo
If the drive is unaccessible, you can get them from here too Release

Launch via python ./test.py --chunk_size 512 or --chunk_size 256 etc

arguments and their default values (see test.py):
--test_dir = ./ShadowDataset/test where the input images are
--input_dir = ./input/
--output_dir = ./output/
--chunk_size = 512 size of sliding window, to split the work into smaller pieces, for performance. Careful, might create seams
--overlap = 64 overlap among the windows, to hide possible seams

Original repo description:

 

arXiv NTIRE NTIRE

PWC PWC PWC

 

Introduction

This is the official PyTorch implementation of ShadowRefiner: Towards Mask-free Shadow Removal via Fast Fourier Transformer in CVPRW 2024. Our ShadowRefiner won the first place in the NTIRE 2024 Challenge on Shadow Removal Perceptual Track and won the second place in the NTIRE 2024 Challenge on Shadow Removal Fidelity Track. If you find this repo useful, please give it a star ⭐ and consider citing our paper in your research. Thank you.

NTIRE 2024 Award

 

 

Overall Framework

Framework

Results

Performance on ISTD, ISTD+, and WSRD+:

results1

Performance on NTIRE 2024 Shadow Removal Challenge---Perceptual Track:

results1

Performance on NTIRE 2024 Shadow Removal Challenge---Fidelity Track:

results1

Create Environment

Dependencies and Installation

  • Python 3.8
  • Pytorch 1.11
  1. Create Conda Environment
conda create --name shadowrefiner python=3.8
conda activate shadowrefiner
  1. Install Dependencies
conda install pytorch=1.11 torchvision cudatoolkit=11.3 -c pytorch

pip install numpy matplotlib scikit-learn scikit-image opencv-python timm kornia einops pytorch_lightning

Datasets

ISTD Google Drive

ISTD+ Google Drive

WSRD+ Train_input, Train_gt, Validation_input, Validation_gt.

Pre-trained Model

Testing

Download above saved models and unzip it into the folder ./weights. To test the model, you need to specify the test dictionary (Line 15) and model path ( Line 34 and 41) in test.py. Then run

python test.py 

You can check the output in ../results.

Citation

If you find our work useful for your research, please consider citing our paper

@article{shadowrefiner_2024_cvprw,
    author    = {Dong, Wei and Zhou, Han and Tian, Yuqiong and Sun, Jingke and Liu, Xiaohong and Zhai, Guangtao and Chen, Jun},
    title     = {ShadowRefiner: Towards Mask-free Shadow Removal via Fast Fourier Transformer},
    journal   = {arXiv preprint arXiv:2406.02559},
}

Contact

If you have any question, please feel free to contact us via [email protected].

About

This is the official PyTorch implementation of ShadowRefiner. Our method is winner of Perceptual Track and achieves the second-best performance for Fidelity Track in NTIRE 2024 Shadow Removal Challenge (CVPR 2024 Workshop)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%