-
Notifications
You must be signed in to change notification settings - Fork 57
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
Question when I use dsnt in my net #17
Comments
Please read the basic usage guide.
You can use the image size to convert from normalized coordinates to pixel coordinates. Now, I can also see that you have some coordinates which are slightly outside of the (-1, 1) range. This implies to me that you have not normalized the heatmaps (e.g. using |
If you use
There's a function that will do the conversion for you: Lines 322 to 334 in 779631f
Your understanding of how the conversion works seems to be correct. |
I use the code used dsnt is the value of batch_location_dsnt I get is
does the output look right now ? Thank you,looking forward to your reply. |
The output is valid, but I can't say whether they are the right answers for your problem 😉 |
I didn't realise you were trying to avoid retraining. I think that the problem you're having is that if you don't retrain, flat_softmax will cause the heatmap values to "flatten" which biases dsnt towards the centre of the image. Your options are:
heatmap -= heatmap.flatten(-2).min(-1)[0][..., None, None]
heatmap /= heatmap.sum([-1, -2], keepdim=True) You may as well try 2), and then if that doesn't work, try 1). |
I have to say, you are so kind!!! |
I have trained a network that obtains key points of the face by supervising the generation of heatmaps.The network uses the max operation to obtain 68 key point coordinates of the face from the key point heat map with 68 channels output by FCN. At present I want to combine this network with another network to train together, but the max operation used before is not differentiable, so I want to replace the max operation with dsnt.
So I use
batch_location_dsnt = dsntnn.dsnt(heatmap)
(the heatmap is obtained by FCN, it's a 68 * 1 * 16 * 16 tensor)but the batch_location_dsnt I obtained is
`tensor([[[ -0.5989, -0.2222]],
Obviously,[-0.5989, -0.2222] doesn't look like coordinates,Why is dsnt not outputting the maximum x and y coordinates like the max operation? How can I get the correct coordinates of the key points?
The text was updated successfully, but these errors were encountered: