princeton-vl / pytorch_stacked_hourglass

Pytorch implementation of the ECCV 2016 paper "Stacked Hourglass Networks for Human Pose Estimation"
BSD 3-Clause "New" or "Revised" License
465 stars 94 forks source link

Regarding the activation of the final regression heatmap #48

Closed vhehduatks closed 9 months ago

vhehduatks commented 9 months ago

https://github.com/princeton-vl/pytorch_stacked_hourglass/blob/ceedc14b9b8814ba641f4a00baa5d0af153588a9/models/posenet.py#L48-L60

Thanks for the great paper. I was going through your code and one question came to mind.

https://github.com/princeton-vl/pytorch_stacked_hourglass/blob/ceedc14b9b8814ba641f4a00baa5d0af153588a9/models/layers.py#L8-L18

I'm wondering why you don't just use the sigmoid function to limit the output to [0,1], since you seem to be regressing the heatmap using only the conv layer in your model.

crockwell commented 9 months ago

I think a sigmoid would be a reasonable choice. I wrote this to replicate the original code (not in PyTorch), so presumably they also did not use sigmoid. I believe the output is truncated to 0,1 anyway; this has the property of having linear predictions rather than nonlinear (if using sigmoid). If I had to guess though, sigmoid would probably have similar or marginally better results.

vhehduatks commented 9 months ago

thx answering