Skip to content

Unofficial implementation of ''BEDSR-Net: A Deep Shadow Removal from a Single Document Image'' with PyTorch

Notifications You must be signed in to change notification settings

IsHYuhi/BEDSR-Net_A_Deep_Shadow_Removal_Network_from_a_Single_Document_Image

Repository files navigation

BEDSR-Net A Deep Shadow Removal Network from a Single Document Image

This repository is unofficial implementation of BEDSR-Net: A Deep Shadow Removal Network From a Single Document Image [Lin+, CVPR 2020] with PyTorch.

architecture

Results

Results from BEDSR-Net pretrained on Jung dataset

Shadow image Non-shadow image Attention Map Background color

Requirements

  • Python3.x
  • PyTorch 1.8.0
  • matplotlib==3.4.2
  • albumentations==0.4.6

Training

You can download the Jung dataset: csv/images.

The data folders should be:

./csv
   - /Jung
       - /train.csv
       - /val.csv
       - /test.csv
       
./dataset
    - /Jung
        - /train
            - /img
            - /gt
            ...
        - /val
            - /img
            - /gt
            ...
        - /test
            - /img
            - /gt
            ...

Making configs

python3 utils/make_configs.py --model benet bedsrnet

Training BE-Net

python3 train_benet.py ./configs/model\=benet/config.yaml

Training BEDSR-Net

python3 train_bedsrnet.py ./configs/model\=bedsrnet/config.yaml

You can use W&B by --use_wandb.

Testing

Please check demo.ipynb.

Trained model

You can download pretrained models trained on Jung dataset.

When you would like to test your own image, you can use demo.ipynb .

References

  • BEDSR-Net_A_Deep_Shadow_Removal_Network_from_a_Single_Document_Image, Yun-Hsuan Lin, Wen-Chin Chen, Yung-Yu Chuang, National Taiwan University, [paper]

TODO

  • implementation of BE-Net
  • training code for BE-Net
  • implementation of SR-Net
  • training code for BEDSR-Net
  • implementation of ST-CGAN-BE
  • calculating code (PSNR/SSIM)
  • inference code
  • Democode in Colab.
  • cleaning up / formatting
  • Writing README
  • providing pretrained model
  • providing synthesized data

About

Unofficial implementation of ''BEDSR-Net: A Deep Shadow Removal from a Single Document Image'' with PyTorch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published