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
469 stars 94 forks source link

Resize image and move keypoints #3

Closed zenghy96 closed 4 years ago

zenghy96 commented 4 years ago

When we use Dataloader via PyTorch, all images should have same size in a batch, so how can I move the labeled keypoints to right position after resizing the image? Thanks!

zenghy96 commented 4 years ago

Maybe you did't use the 'Dataloader' in PyTorch?

crockwell commented 4 years ago

Correct -- they will have the same size, currently set to 256,256. During training, keypoints will accordingly be warped using utils.img.kpt_affine (you can see this called in data/MPII/dp.py line 88). Currently, the program is setup to return heatmaps based on these keypoints, but you can easily modify to also return keypoints. During inference, we do the opposite: map keypoints predicted on 256, 256 size to the original image. See line 15 of test.py for details.