Skip to content

Latest commit

 

History

History
102 lines (89 loc) · 3.24 KB

README.md

File metadata and controls

102 lines (89 loc) · 3.24 KB

Channel Attention GAN Trained with Enhanced Dataset for Single-Image Shadow Removal (CANet)

Our Paper is published in IEEE Access. You can check the paper here.

Overview

Datasets

  • ISTD : ST-CGAN
  • SRD : Deshadow-Net
  • ISTD+, SRD+
    Datasets are not available but you can create the dataset by applying the MATLAB code provided by the authors.

Our results

Create environment with Anaconda

conda create -n CANet python=3.8 -y
conda activate CANet
conda init
conda install -c pytorch torchvision=0.10.0 -y
conda install -c conda-forge scikit-image -y

Train

  1. Prepare the training dataset. You need to prepare the edge mask by yourself. Run makemask.m with MATLAB on the mask images to obtain the edge mask dataset.
  2. Execute the following command.
(This is an example.)

python CANet_train.py \
    --train_name train1 \
    --shadow_dir_path datasets/ISTD/train/train_A \
    --gt_dir_path datasets/ISTD/train/train_C \
    --mask_dir_path datasets/ISTD/train/train_B \
    --mask_edge_dir_path datasets/ISTD/train/train_B_edge \
    --pretrained_d detect_ISTD.pth(optional) \
    --pretrained_r remove_ISTD.pth(optional)

Test

  1. Prepare the trained weights.
    Our pre-trained weights can be downloaded from Google Drive.
  2. Prepare the test images and put them in a single directory.
  3. Execute the following command.
python CANet_test.py \
    --detection_pth_path <path of .pth> \
    --removal_pth_path <path of .pth>  \
    --input_img_path <path of directory>
  1. Directory output_CANet is automatically created and the output images are saved here.

Evaluation

  1. Put your results under results/<dataset name>/<method name>.
  2. Make sure that the test images are located under datasets/<dataset name>.
  3. Run the following command.
python evaldata.py \
    --method_name <method name> \
    --dataset_name ISTD \
    --resized 1

Directory structure

CANet
├── evaldata.py
├── getDatasetPath.py
├── README.md
├── datasets/
│   ├── ISTD/
│       ├── test/
│           ├── test_A/
│               ├── 101.png
│           ├── test_B/
│           ├── test_C/
│       ├── train/
├── results/
│   ├── ISTD/
│       ├── CANet/
│           ├── 101.png

Results

Comparison with the other methods. Please see our paper for the details. Overview

Citation

@ARTICLE{ryo2022,
  author={Ryo Abiko and Masaaki Ikehara},
  journal={IEEE Access}, 
  title={Channel Attention GAN Trained With Enhanced Dataset for Single-Image Shadow Removal}, 
  year={2022},
  volume={10},
  number={},
  pages={12322-12333},
  doi={10.1109/ACCESS.2022.3147063}}