The transplantation of pytorch implementation of "Learning Single Image Defocus Deblurring with Misaligned Training Pairs" on huawei mindspore platform. Original project is here. Due to some platform limits, this project only transplants single device training and testing codes with original torch weights converted to measure precisions.
this transplantation based on huaweicloud ModelArts platform with following environment:
- python 3.7
- mindspore 1.7.0
- cuda 10.1
Main third party packages:
- numpy 1.19.5
- opencv-python 4.6.0
- natsort 8.1.0
- scikit-image 0.19.3
- yacs 0.1.8
- tqdm 4.64.1
Test precisions on SDD test and DPDD test.
Test training scripts on SDD train.
model | PSNR | SSIM |
---|---|---|
mprnet-torch-sdd | 26.88 | 0.81 |
mprnet-mindspore-sdd* | 24.8 | 0.753 |
mprnet-torch-dpdd | 25.73 | 0.792 |
mprnet-mindspore-dpdd | 25.64 | 0.788 |
* In SDD testing usage of mindspore implementation of PWC-Net which is different from official torch implementation causes the most of precisions lost.
Mindspore implementation suffers a precisions lost from the different implementation of the Bilinear Interpolation operator, which should not be a problem with completely retraining on the new platform.
- Ajust configs in
training.yml
, including datasets path, epochs, batchsize, etc. - run
train.sh
- Edit the checkpoint path and dataset path in
test.sh
, and choose dataset - run
test.sh
Any GPUs support mindspore can be used for training or testing, but make sure you have at least 22GB of memory on GPU in total. Not tested in Ascend devices, but it should work.