flatnet icon indicating copy to clipboard operation
flatnet copied to clipboard

how ro padding the measurement whrn working with smaller sensors

Open zhangyingerjelly opened this issue 3 years ago • 6 comments

As you mentioned in https://siddiquesalman.github.io/flatnet/, when using a smaller sensors, we always get a small measurement (eg. dataset in DiffuserCam), and only zero padding the measurement seems work badly in the inverse layer, and "replicate+smooth padding" can address this problem, but I don't find code of this part in the project, so how to do "replicate+smooth padding" ?

zhangyingerjelly avatar Aug 24 '22 06:08 zhangyingerjelly

Hi,

replicate padding is done in the dataloader: https://github.com/siddiquesalman/flatnet/blob/flatnet-gen/dataloader.py#L130

smoothing is done here: https://github.com/siddiquesalman/flatnet/blob/flatnet-gen/models/fftlayer.py#L132

siddiquesalman avatar Aug 24 '22 16:08 siddiquesalman

Thank you for your answer, and did you try this FFT layer on the dataset DiffuserCam (https://waller-lab.github.io/LenslessLearning/dataset.html)? I tried to use FFT layer on DiffuserCam's psf and measurement, but failed get a understandable image.

zhangyingerjelly avatar Aug 25 '22 07:08 zhangyingerjelly

I'm soryy to bother, I found something wrong with the hyparameter, and and I have success on Diffusercam.

zhangyingerjelly avatar Aug 25 '22 10:08 zhangyingerjelly

@zhangyingerjelly Could you please share how to try this FFT layer on the dataset DiffuserCam and how to set the hyparameter?Thank you!

manlupanshan avatar Oct 24 '22 09:10 manlupanshan

@zhangyingerjelly Could you please share how to try this FFT layer on the dataset DiffuserCam and how to set the hyparameter?Thank you!

you should pay attention that both psf and input data need to be normalized(something like /np.max(). and I set fft_gamma=2000

zhangyingerjelly avatar Oct 24 '22 11:10 zhangyingerjelly

Thank you for your reply.

manlupanshan avatar Oct 24 '22 11:10 manlupanshan