File size: 1,414 Bytes
2ecc7ab | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ## Training
- To download DPDD training data, run
```
python download_data.py --data train
```
- Generate image patches from full-resolution training images, run
```
python generate_patches_dpdd.py
```
- To train Restormer on **single-image** defocus deblurring task, run
```
cd Restormer
./train.sh Defocus_Deblurring/Options/DefocusDeblur_Single_8bit_Restormer.yml
```
- To train Restormer on **dual-pixel** defocus deblurring task, run
```
cd Restormer
./train.sh Defocus_Deblurring/Options/DefocusDeblur_DualPixel_16bit_Restormer.yml
```
**Note:** The above training scripts use 8 GPUs by default. To use any other number of GPUs, modify [Restormer/train.sh](../train.sh) and [DefocusDeblur_Single_8bit_Restormer.yml](Options/DefocusDeblur_Single_8bit_Restormer.yml)
## Evaluation
- Download the pre-trained [models](https://drive.google.com/drive/folders/1bRBG8DG_72AGA6-eRePvChlT5ZO4cwJ4?usp=sharing) and place them in `./pretrained_models/`
- Download test dataset, run
```
python download_data.py --data test
```
- Testing on **single-image** defocus deblurring task, run
```
python test_single_image_defocus_deblur.py --save_images
```
- Testing on **dual-pixel** defocus deblurring task, run
```
python test_dual_pixel_defocus_deblur.py --save_images
```
The above testing scripts will reproduce image quality scores of Table 3 in the paper.
|