pose-hg-demo icon indicating copy to clipboard operation
pose-hg-demo copied to clipboard

Question about center & scale

Open girafffeee opened this issue 7 years ago • 1 comments

HI: in your code: inputImg = crop(img, center, scale, rot, res) how should i set the value of "center" and "scale" if i know the bounding box of a single person in img? thx~

girafffeee avatar Mar 23 '17 12:03 girafffeee

My recommendation is to set "center" to the center of the bounding box (straightforward enough), and then for "scale" you need to play around a bit. Use the max dimension of the box (either height or width) and divide by a constant factor. I can't say off the top of my head what a good value would be, but play around with the code. You can call crop and display the resulting image. Ideally a standing person should be centered and take up about 70-80% of the image height.

The main issue with boxes is that it is hard to tell if the figure is truncated, and you might see some bad performance for figures where only the upper half of the body is visible. In this case, maybe try adapting the center and scale based off of the aspect ratio of the box. Ultimately, one of the limits of training to rely specifically on these center and scale terms is that it is hard to directly generalize to bounding boxes, but I think you should still be able to produce reasonable predictions.

anewell avatar Mar 24 '17 15:03 anewell