wbenbihi / hourglasstensorflow

Tensorflow implementation of Stacked Hourglass Networks for Human Pose Estimation
MIT License
479 stars 177 forks source link

Added format and scale #56

Closed derekpankaew closed 2 years ago

derekpankaew commented 5 years ago

Added a function to format and re-scale the predictions.

formatAndScale.py does 2 things:

1) Changes from List to Dict, so you can access the coordinates using the name of a body part, i.e. "Right Ankle"

2) Scales the data from 256x256 back to your original height and width For example, if original image is 1280x720, the returned result will be the X,Y coordinates for a 1280x720 image, rather than for a 256x256 image

It takes the prediction from hourglass, plus the original height and width, as input. Returns a dict of coordinates, scaled back to original size.