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:
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.
- Python 3.8
- Pytorch 1.11
- Create Conda Environment
conda create --name shadowrefiner python=3.8
conda activate shadowrefiner
- 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
ISTD Google Drive
ISTD+ Google Drive
WSRD+ Train_input, Train_gt, Validation_input, Validation_gt.
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
.
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},
}
If you have any question, please feel free to contact us via [email protected].