Menu

Tree [6d8d68] main latest-v2 /
 History

HTTPS access


File Date Author Commit
 Restormer 2024-03-24 movingforward100 movingforward100 [3b7118] Add files via upload
 ShadowDataset 2024-03-24 movingforward100 movingforward100 [3b7118] Add files via upload
 figure 2024-09-01 movingforward100 movingforward100 [443555] Add files via upload
 saicinpainting 2024-03-24 movingforward100 movingforward100 [4bbbba] Add files via upload
 weights 2024-03-24 movingforward100 movingforward100 [27802e] Update put weights here.txt
 .gitignore 2024-12-08 Igor Aherne Igor Aherne [bf78a2] added gitignore. Input and output dirs no longe...
 LICENSE.txt 2024-06-07 movingforward100 movingforward100 [bb3520] Add files via upload
 README.md 2024-12-09 Igor Aherne Igor Aherne [6d8d68] Update README.md
 model.py 2024-03-31 movingforward100 movingforward100 [94c556] Update model.py
 model_convnext.py 2024-03-24 movingforward100 movingforward100 [3b7118] Add files via upload
 myFFCResblock0.py 2024-03-24 movingforward100 movingforward100 [3b7118] Add files via upload
 requirements.txt 2024-12-03 Igor Aherne Igor Aherne [9d7ff1] enhanced the requirements.txt, to avoid missing...
 test.py 2024-12-08 Igor Aherne Igor Aherne [2736e2] renamed patches to chunks
 test_dataset.py 2024-12-08 Igor Aherne Igor Aherne [bf78a2] added gitignore. Input and output dirs no longe...

Read Me

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](https://img.shields.io/badge/arxiv-paper-179bd3)](https://arxiv.org/abs/2406.02559) [![NTIRE](https://img.shields.io/badge/Winner_of_NTIRE_2024_Perceptual_Track-leaderboard_User🥇_ylxb-179bd3)](https://codalab.lisn.upsaclay.fr/competitions/17546#results) [![NTIRE](https://img.shields.io/badge/Second_Place_of_NTIRE_2024_Fidelity_Track-leaderboard_User🥈_ZXCV-179bd3)](https://codalab.lisn.upsaclay.fr/competitions/17539#results) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/shadowrefiner-towards-mask-free-shadow/shadow-removal-on-adjusted-istd)](https://paperswithcode.com/sota/shadow-removal-on-adjusted-istd?p=shadowrefiner-towards-mask-free-shadow) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/shadowrefiner-towards-mask-free-shadow/shadow-removal-on-istd)](https://paperswithcode.com/sota/shadow-removal-on-istd?p=shadowrefiner-towards-mask-free-shadow) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/shadowrefiner-towards-mask-free-shadow/shadow-removal-on-wsrd)](https://paperswithcode.com/sota/shadow-removal-on-wsrd?p=shadowrefiner-towards-mask-free-shadow)

 

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](/figure/performance.png)
Performance on NTIRE 2024 Shadow Removal Challenge---Perceptual Track: ![results1](/figure/perceptual.png)
Performance on NTIRE 2024 Shadow Removal Challenge---Fidelity Track: ![results1](/figure/fidelity.png)

Create Environment

Dependencies and Installation

  • Python 3.8
  • Pytorch 1.11

  • 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 wdong1745376@gmail.com.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.