From e38595c194c3bf37ac87a9c951a40cd0437fafd6 Mon Sep 17 00:00:00 2001 From: rajeevyasarla Date: Sat, 3 Aug 2019 09:58:17 -0400 Subject: [PATCH] UMSN Files --- README.md | 7 ++++++- test_data_generation.m | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test_data_generation.m diff --git a/README.md b/README.md index cfd119a..b1efd7f 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,13 @@ We propose a novel multi-stream architecture and training methodology that explo 2. Python 2 or 3 3. CPU or NVIDIA GPU + CUDA CuDNN (CUDA 8.0) + ## To test UMRL: -python test_face_deblur.py --dataroot ./facades/github/ --valDataroot --netG ./pretrained_models/Deblur_epoch_Best.pth +1. Download test datasets provided the authors of Ziyi et al. + - https://sites.google.com/site/ziyishenmi/cvpr18_face_deblur +2. run test_data_generation.m + - It renames the files counting from example 000001.png +3. python test_face_deblur.py --dataroot ./facades/github/ --valDataroot --netG ./pretrained_models/Deblur_epoch_Best.pth ## To train UMRL: python train_face_deblur.py --dataroot --valDataroot ./facades/github/ --exp ./face_deblur --batchSize 10 diff --git a/test_data_generation.m b/test_data_generation.m new file mode 100644 index 0000000..7929773 --- /dev/null +++ b/test_data_generation.m @@ -0,0 +1,31 @@ +close all; +clear all; +clc; +%Download Test Data provided by authors Ziyi et al. from, +%https://sites.google.com/site/ziyishenmi/cvpr18_face_deblur +listinfo = dir('./Test_data_Helen/final_Helen_gt'); +m = length(listinfo); +count =1; +for i = 3:m + imgname = strcat('./Test_data_Helen/final_Helen_gt','/',listinfo(i).name); + tmp = listinfo(i).name; + tmp1 = split(tmp,'.'); + I = imread(imgname); + im_name = tmp1{1}; + for j = 1:10 + for k = 13:2:27 + blrname = strcat('./Test_data_Helen/final_Helen_blur/',im_name,'_ker',num2str(j,'%02d'),'_blur_k',num2str(k),'.png'); + B = imread(blrname); + blrname = strcat('./final_Helen_result/',im_name,'_ker',num2str(j,'%02d'),'_blur_k',num2str(k),'_random.png'); + S = imread(blrname); + filename = strcat('./Testh_gt/',num2str((count),'%06d'),'.png'); + imwrite(I,filename); + filename = strcat('./Testh/',num2str((count),'%06d'),'.png'); + imwrite(B,filename); + filename = strcat('./Testh_st/',num2str((count),'%06d'),'.png'); + imwrite(S,filename); + count = count+1; + end + end + i +end