Home

Awesome

SG in PyTorch

Implementation of "Self-generated Defocus Blur Detection via Dual Adversarial Discriminators" in PyTorch

Datasets

baidu link: https://pan.baidu.com/s/1_3Z7w9IrlqOU25QbVdhytQ passward: aktv

google link: https://drive.google.com/file/d/1DtWbMUppxa8eC0O3ZVBjLQO_i5GUG1pa/view?usp=sharing

Test

You can use the following command to test:

python test.py --stict PRETRAINED_WEIGHT --image_path IMG_PATH --mask_save_path SAVE_PATH

We have trained the model and We got FM about 0.701 and MAE about 0.172 on DUT Dataset and got FM about 0.769 and MAE about 0.119 on CUHK Dataset. You can use the following model to output results directly.

Here is our parameters: baidu link: https://pan.baidu.com/s/1XbRiUnXr6LlgFNbWUWjQ3g passward: nm2l

google link: https://drive.google.com/file/d/1Q6odk3yGexqFIt6Iu3WNFRoInWealy_2/view?usp=sharing

Put "generator.pth" in "./checkpoints".

Train

You can use the following command to train:

python train.py --path_clear CLEAT_DATA_PATH --path_blur BLUR_DATA_PATH --path_gt GT_DATA_PATH

Here is the pretrained weight of the Classifier.Put "VGG16model" in "./models"

baidu link: https://pan.baidu.com/s/1ZrtEVoYQjUVUWgzJ68gwvQ passward: 26jm

google link: https://drive.google.com/file/d/1K4OAo-WEKmizFt4edQzeqBp-eNgurZft/view?usp=sharing

Eval

If you want to use FM and MAE to evaluate the results, you can use the following code:

python eval.py --mask_path MASK_PATH --gt_path GT_PATH

If you want to get the PR curve and FM curve in the article, use the following code:

python plt_pr.py

python plt_fm.py