Giter Club home page Giter Club logo

sid's Introduction

Shadow Removal via Shadow Image Decomposition

Pytorch implementation for ICCV19 "Shadow Removal via Shadow Image Decomposition" and PAMI21 "Physics-based Shadow Image Decomposition for Shadow Removal"

Project Page

Paper: https://arxiv.org/abs/2012.13018

Download links:

SBU-TimeLapse Dataset

SBU-TimeLapse Results

Adjusted ISTD Dataset

Please note that the ISTD dataset is the contribution of Wang et al. (CVPR18). Here we just provide an adjusted version of its with slight modifications: we adjust the shadow-free images, the shadow images and shadow masks stay the same as of the original ISTD dataset. If you are using the Adjusted ISTD Dataset, kindly consider to cite the original ISTD paper as well.

Note on the shadow removal evaluation code: We recently figured that the RMSE evaluation code that many papers have been using (including ours) is actually calculating Mean Absolute Error. We will retrospectively fix this in all our papers and suggest everyone to do the same.

This MAE evaluation code can be downloaded here: https://drive.google.com/file/d/1-lG8nAJbWajAC4xopx7hGPKbuwYRw4x-/view?usp=sharing

New: Please check out Weakly Supervised Shadow Removal, our new unparied patch-to-patch translation model for shadow removal.

This pytorch implementation is heavily based on the pix2pix framework written by Jun-Yan Zhu. Many thanks!

Pretrained-model:

----ICCV19 version with limiting the search space for shadow parameters (Our model reported in the ICCV19 paper does not include this simple technique):

https://drive.google.com/drive/folders/17G_lf1k2CNt9wt4X2hWxeT8-7bOXpWQe?usp=sharing

----PAMI21 (Accepted) version with the inpaining network:

https://drive.google.com/drive/folders/1K9EZ-9viGeZ3MlNDlzgAUcguSb5xFp_8?usp=sharing

Testing

  1. Download the pretrained-model above and but them into ./checkpoint_path/model_name/..pth
  2. Set the path to the shadow-mask of the test set

For the ICCV19 version:

python infer.py --model SIDPAMIw --name model_name --epoch best

For the PAMI version:

python infer.py --model SIDPAMIwinp --name model_name --epoch best

Training

To generate "train_params": please run the ipython notebook included in "data_processing".

Please refer to the training script in the "scripts" folder.

Shadow removal results:

SBU: https://drive.google.com/file/d/1I0_m68_dKwK4gD6WSRgChtXaNrvsU56l/view?usp=sharing

ISTD: https://drive.google.com/file/d/1m6FLiswQYiAiheJrJhofBQkyvQte8mt_/view?usp=sharing

If you are using this code for research, please cite:

Physics-based Shadow Image Decomposition for Shadow Removal - PAMI 2021 (Accepted)
Hieu Le and Dimitris Samaras

@misc{le2020physicsbased,
      title={Physics-based Shadow Image Decomposition for Shadow Removal}, 
      author={Hieu Le and Dimitris Samaras},
      year={2020},
      eprint={2012.13018},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}


Shadow Removal via Shadow Image Decomposition 
Hieu Le and Dimitris Samaras

@InProceedings{Le_2019_ICCV,
	author = {Le, Hieu and Samaras, Dimitris},
	title = {Shadow Removal via Shadow Image Decomposition},
	booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
	month = {October},
	year = {2019}
}

And also take a look at our other shadow papers:

A+D-Net: Shadow Detection with Adversarial Shadow Attenuation
Hieu Le, Tomas F. Yago Vicente, Vu Nguyen, Minh Hoai, Dimitris Samaras

@inproceedings{m_Le-etal-ECCV18,
Author = {Hieu Le and Tomas F. Yago Vicente and Vu Nguyen and Minh Hoai and Dimitris Samaras},
Booktitle = {Proceedings of European Conference on Computer Vision},
Title = {{A+D Net}: Training a Shadow Detector with Adversarial Shadow Attenuation},
Year = {2018}}


From Shadow Segmentation to Shadow Removal
Hieu Le and Dimitris Samaras

@InProceedings{Le_2020_ECCV,
	author = {Le, Hieu and Samaras, Dimitris},
	title = {From Shadow Segmentation to Shadow Removal},
	booktitle = {The IEEE European Conference on Computer Vision (ECCV)},
	month = {August},
	year = {2020}
}

sid's People

Contributors

hieulem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sid's Issues

no link to the adjusted ISTD dataset?

Hello, your work is very exciting, thank you for your contribution to this field.
But I can’t find where to download your adjusted ISTD dataset? Why is there no link to the adjusted data set in the readme file, but only the test results? Can you provide the adjusted training set and test set?
Thank you for your work and look forward to your reply.

Questions about evaluation

Hello, thanks for the code, it really helps.

Can you provide the function about calculating the RMSE?

ISTD+ dataset

Where is the script for 'adjusted ISTD dataset'? Is that the augmentation code in data_processing? But it doesn't work. Please help me. Thank you.

evaluation problem

I used the evaluation code you provided, but I got a different result from the paper on the AISTD dataset. After I resize the image to 256×256, I found that your method is consistent with the paper, but the result of input image is inconsistent with the paper.

How to train this model on customer dataset

Hi,
I want to try this model on customer dataset, as the readme.txt instruct, I need generate param.txt first, but I'm a little confused about what the 'sdfree_path=train_c_fixed_ours' means

looking forward to your response

How to use DataSet?

Hi, I want to know how to use the dataset?
how to change dataset to this project accepted input?
What "set the path to the shadow-mask of the test set" mean? where could I get shadow-mask ?
Thanks for any help!

I-Net

Hi, I seem not see anywhere I-Net used in this github code, where does the I-Net work in this project?

Thanks!

CUDA version

Hi, thanks for your contribute!
I want to know which cuda version is used in this project?
I install cuda 10.1 but it show "RuntimeError: CUDA error: invalid device ordinal" when i run
python infer.py --model SIDPAMIw --name .\checkout\best_net_G.pth --epoch best

Thanks for any help!

Thanks for your contribution,and I want to ask where is the models.cycle_gan_model?

Traceback (most recent call last):
File "D:/wk_test/SID-main/src/SID_train.py", line 11, in
opt = TrainOptions().parse()
File "D:\wk_test\SID-main\src\options\base_options.py", line 108, in parse
opt = self.gather_options()
File "D:\wk_test\SID-main\src\options\base_options.py", line 73, in gather_options
model_option_setter = models.get_option_setter(model_name)
File "D:\wk_test\SID-main\src\models_init_.py", line 30, in get_option_setter
model_class = find_model_using_name(model_name)
File "D:\wk_test\SID-main\src\models_init_.py", line 10, in find_model_using_name
modellib = importlib.import_module(model_filename)
File "E:\Anaconda3\envs\pytorch-CycleGAN-and-pix2pix\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'models.cycle_gan_model'

How to test ISTD dataset with original size

Hi, I notice that in infer.py the size of the images are set to 256x256. May I know how can I run inference on image of original size, i.e. 480x680. I tried to uncomment line 38 and line 39 in src/data/single_dataset.py to not resizing them but it didn't work, runtime error shows that "Sizes of tensors must match except in dimension 2. Got 2 and 3 (The offending index is 0)".

Thanks!

Internal work array size computation failed: -5

when I compute param, I met this error, could you give me some help? cause I can't go on.

Intel MKL ERROR: Parameter 5 was incorrect on entry to DGESDD.
Traceback (most recent call last):
  File "data_processing/compute_params.py", line 89, in <module>
    Rpopt, pcov = curve_fit(relit, R_s, R_t,bounds=c_bounds)
  File "/data1/xing_zhao/anaconda3/lib/python3.7/site-packages/scipy/optimize/minpack.py", line 764, in curve_fit
    _, s, VT = svd(res.jac, full_matrices=False)
  File "/data1/xing_zhao/anaconda3/lib/python3.7/site-packages/scipy/linalg/decomp_svd.py", line 125, in svd
    compute_uv=compute_uv, full_matrices=full_matrices)
  File "/data1/xing_zhao/anaconda3/lib/python3.7/site-packages/scipy/linalg/lapack.py", line 700, in _compute_lwork
    "%d" % (info,))
ValueError: Internal work array size computation failed: -5

Question about the augmented ISTD dataset

The effect of your paper on shadow removal is particularly good, so I hope I can reproduce this result and learn more from it.
I found that the RMSE drops by 6% after dataset augmentation. Can you share the augmented dataset to me?
Thank you!

How to obtain input['penumbra']?

I am training the model SIDPAMIwinp with my own dataset and got the following issue:

Traceback (most recent call last):
File "../SID_train.py", line 31, in
model.set_input(data)
File "/home/Research_Projects/SID/src/models/SIDPAMIwinp_model.py", line 83, in set_input
self.penumbra = input['penumbra'].to(self.device).type(torch.float)
KeyError: 'penumbra'

I checked all the files in 'data' folder but there is no operation to obtain input['penumbra']. Could you please explain how to get this? Thank you very much!

mask of ISTD_crf

Many thanks for your excellent work. Can you provide the mask of ISTD-CRF for the following comparison?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.