Skip to content

Flask app to implement shadow removal using ST-CGAN

Notifications You must be signed in to change notification settings

Param-Raval/shadow-sight

Repository files navigation

Shadow Sight

Shadow Detection and removal is the process of enhance the computer vision applications including image segmentation, object recognition, object tracking etc. Detection and Removal of shadow from the images and videos can reduce the undesirable outcomes in the computer vision applications and algorithms.

  • ShadowSight uses Stacked Conditional GANs trained on ISTD and implemented unofficially in this project.

  • This project gives the service of shadow detection and removal in the form of a Flask application

Requirements

  • Flask
  • Python3.x
  • PyTorch 1.5.0
  • pillow
  • matplotlib

Run

  • Download the checkpoints (pre-trained model) from here and place them in a folder called checkpoints.
  • Run app.py to start the application locally. You can make changes to parameters inside the scripts as needed.

Some Implementation Details from the ST-CGAN project

Usage

  • Set datasets under ./dataset. You can Download datasets from here.

Then,

Training

python3 train.py

Testing

When Testing images from ISTD dataset.

python3 test.py -l <checkpoint number>

When you would like to test your own image.

python3 test.py -l <checkpoint number> -i <image_path> -o <out_path>

Results

Here is a result from test sets. (Left to right: input, ground truth, shadow removal, ground truth shadow, shadow detection)

Shadow Detection

Here are some results from validation set. (Top to bottom: ground truth, shadow detection)

Shadow Removal

Here are some results from validation set. (Top to bottom: input, ground truth, shadow removal)

Trained model

You can download from here.

References

  • Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal, Jifeng Wang, Xiang Li, Le Hui, Jian Yang, Nanjing University of Science and Technology, [arXiv]

About

Flask app to implement shadow removal using ST-CGAN

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published