codeslake / DMENet

[CVPR 2019] Official TensorFlow Implementation for "Deep Defocus Map Estimation using Domain Adaptation"
GNU Affero General Public License v3.0
122 stars 24 forks source link

Normalization #22

Closed ryanxingql closed 2 years ago

ryanxingql commented 2 years ago

Hi Lee, I notice here we store the estimated map after converting it into an image. This may introduce normalization. I am wondering what is the network output range? What if the output ranges outside [0, 1]? Thank you!

codeslake commented 2 years ago

Hi, @ryanxingql.

The predicted defocus map is in the range [0, 1], so the scipy.misc.toimage() function does not normalize the defocus map as we provided the appropriate range. Note that the ground truth defocus maps are also in the same range between 0 and 1.

We've provided sigma_map to get the actual sigma value.

ryanxingql commented 2 years ago

Thank you! And also, what is the use of the sigma map? Is it for deblurring?

codeslake commented 2 years ago

Thank you! And also, what is the use of the sigma map? Is it for deblurring?

Yes!

ryanxingql commented 2 years ago

Thank you so much ^ ^

ryanxingql commented 2 years ago

Hi @codeslake, I would like to ask you a question.

My understanding: Our gray-scale defocus maps are ranging from 0 to 255. Therefore, pixels with 0-values are focused, while the maximal available defocus value is 255 since the maximal COC for training is 15. If a object in test images reaches out of this COC, its defocus value is still 255. In this situation, the output is somehow incorrect.

Am I right? Thank you.

codeslake commented 2 years ago

Yes, you are right. DMENet will not be able to accurately predict the COC values of a test image, if the COC values are larger than the maximum COC used to create the training set.

ryanxingql commented 2 years ago

@codeslake Thank you!