rajeevyasarla / UMSN-Face-Deblurring

Deblurring Face Images using Uncertainty Guided Multi-Stream Semantic Networks
MIT License
118 stars 34 forks source link

Blur kernels wrong #20

Closed GangMieYe closed 3 years ago

GangMieYe commented 3 years ago

When I trained this network,I found the kernels.mat in files is zero.How should I use this blur kernel? Thanks for your reply

rajeevyasarla commented 3 years ago

follow the lines 76-80 in train_face_deblur.py to load the kernel.mat kernel.mat is not zero matrix, it contains 25000 motion kernels generated using, [Boracchi and Foi, 2012] Modeling the Performance of Image Restoration from Motion Blur Giacomo Boracchi and Alessandro Foi, Image Processing, IEEE Transactions on. vol.21, no.8, pp. 3502 - 3517, Aug. 2012,

>>> import h5py
>>> import numpy as np
>>> k_filename ='./kernel.mat'
>>> kfp = h5py.File(k_filename)
>>> kernels = np.array(kfp['kernels'])
>>> kernels = kernels.transpose([0,2,1])
>>> sum(sum(sum(kernels)))
24999.999999999993
>>> sum(sum(kernels[1,:,:]))
1.0
>>>