diff --git a/README.md b/README.md index 2d1b22e..25c18a2 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,66 @@ conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11 pip install opencv-python tqdm pyyaml joblib glog scikit-image tensorboardX albumentations==1.1.0 pip install -U albumentations[imgaug] ``` + + +## Training +Download "[GoPro](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" dataset into './datasets'
+For example: './datasets/GoPro/train/blur/\*\*/\*.png' + +**We train our Stripformer in two stages:**
+**1) We pre-train Stripformer for 3000 epochs on patch size 256x256. Please run the following commands.**
+``` +python pretrained.py +``` + +**2) After stage 1, we keep training Stripformer for 1000 epochs on patch size 512x512. Please run the following commands.**
+``` +python train.py +``` + +## Testing +For reproducing our results on GoPro and HIDE dataset, download the "[Stripformer_gopro.pth](https://drive.google.com/file/d/1pqK-L-A2FpFtJtvv2Ef6_vapjH9_IBzV/view?usp=sharing)" + +For reproducing our results on RealBlur dataset, download "[Stripformer_realblur_J.pth](https://drive.google.com/file/d/1n6SRXmv4ZXgLiF5ZcfRdA0HGdvg-tJQk/view?usp=sharing)" and "[Stripformer_realblur_R.pth](https://drive.google.com/file/d/1dtFCNrEK3WFvKHxIOVtichycH89UXh0E/view?usp=sharing)" + +* For testing on GoPro test set
+Download "[GoPro](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" full dataset or test set into './datasets'
+For example: './datasets/GoPro/test/blur/\*\*/\*.png' +``` +python predict_GoPro_test_results --weights_path ./Stripformer_gopro.pth +``` +* For testing on HIDE dataset
+Download "[HIDE](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './datasets'
+``` +python predict_HIDE_results --weights_path ./Stripformer_gopro.pth +``` +* For testing on RealBlur test sets +Download "[RealBlur_J](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" and "[RealBlur_R](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './datasets'
+``` +python predict_RealBlur_J_test_results --weights_path ./Stripformer_realblur_J.pth +``` +``` +python predict_RealBlur_R_test_results --weights_path ./Stripformer_realblur_R.pth +``` + +* For testing your own training weight (take GoPro for a example) +1) Rename the path in line 23 in the predict_GoPro_test_results.py
+2) Chage command to --weights_path ./final_Stripformer_gopro.pth when testing + +## Evaluation +* For evaluation on GoPro results in MATLAB, download "[Stripformer_GoPro_results](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './out' +``` +evaluation_GoPro.m +``` +* For evaluation on HIDE results in MATLAB, download "[Stripformer_HIDE_results](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './out' +``` +evaluation_HIDE.m +``` +* For evaluation on RealBlur_J results, download "[Stripformer_realblur_J_results](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './out' +``` +python evaluate_RealBlur_J.py +``` +* For evaluation on RealBlur_R results, download "[Stripformer_realblur_R_results](https://drive.google.com/drive/folders/1AlGIJZBsTzH5jdcouHlHIUx_vZgE6EMC?usp=sharing)" into './out' +``` +python evaluate_RealBlur_R.py +```