Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output of DMENet #10

Closed
chanwental opened this issue Oct 29, 2020 · 6 comments
Closed

Output of DMENet #10

chanwental opened this issue Oct 29, 2020 · 6 comments

Comments

@chanwental
Copy link

Hi,Dr.Lee.

When I test the network,I get the file named as xxxx_2_defocus_map_out.png.

I want to know what value is saved in this file .

Thank you and look forward to your reply!

Best,
Cheng

@codeslake
Copy link
Owner

It contains the value of sigma, if you test our model with the model checkpoint that we shared.
(We have retrained the model with SYNDOF dataset containing sigma value. When we read the dataset, we did not divide it by 15.)

If you train the model with SYNDOF that we shared, xxxx_2_defocus_map_out.png. will contain max-normalized max_coc.
If you want to get sigma, you have to do ((network_ouput*15) - 1)/2 during training and testing.

Sorry for the confusion.

@chanwental
Copy link
Author

I am still confused.

The file named as xxxx_2_defocus_map_out.png is generated when I test the model with the model checkpoint that you shared.
1)The input is synthetic image generateed by your SYNDOF code (max_coc=29). So the corresponding blur_map is known and the max_sigma is known (max_sigma=7). But the range of value in xxxx_2_defocus_map_out.png is not around [0, 7].
2)The blur_map is not visible. That's reasonable because It contains the value of sigma(*10).
However, the xxxx_2_defocus_map_out.png is visible. The values saved in it don't seem to be sigma.

I read a xxxx_2_defocus_map_out.png as follows:

file_name = 'logs/DMENet_BDCS/samples/1_test/2020_10_29/19-29/out/0000.png'
image = ((cv2.imread(file_name, cv2.IMREAD_UNCHANGED)))

@codeslake
Copy link
Owner

I apologize again for the confusion.

My previous answer was wrong.

  1. We have not retrained the network SYNDOF containing sigma value.

  2. If you are using the model and checkpoint that I shared for testing an image, the value of xxxx_2_defocus_map_out.png contains "max-normalized" CoC. If you want to get actual sigma value, you will have to do.

sigma = ((defocus_map * 15) - 1) / 2.

@chanwental
Copy link
Author

I found that the maximum of values in a defocus_map is around 200. And every defocus_map has different one.
It doesn't seem to be the value normalized.

If max_defocus_map =200, max_sigma is 1499.5.

@codeslake
Copy link
Owner

I don't get it. The range of defocus_map should between 0 and 1 as the final layer of the network is sigmoid.

Try this.

defocus_map = ((cv2.imread(file_name, cv2.IMREAD_UNCHANGED))) / 255.
sigma = ((defocus_map * 15) - 1) / 2.

@chanwental
Copy link
Author

Thank you. I get it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants