shape_templates icon indicating copy to clipboard operation
shape_templates copied to clipboard

Visualizing the keypoints

Open CanKeles5 opened this issue 1 year ago • 5 comments

Hi,

I am using the pre-trained model and running inference on my own dataset.I wasnt able to find any code that would convert the returned heatmaps to keypoints. I want to visualize the models predictoins. Is there any function in the repository that I could use?

Thanks

CanKeles5 avatar Apr 05 '23 20:04 CanKeles5

Hi,

sorry for the late reply. The Predictor class in pretrained_model.py returns tensors containing the xy-coordinates for the anchorpoints of all transformed parts. There are duplicates in there because some are overlapping by design, so you would have to pick the ones you're interested in by indexing.

lschmidtke avatar Apr 11 '23 12:04 lschmidtke

Thank you for your reply.

When I run inference, I get 3 sets of anchor points with shapes [1, 1, 3, 3, 1], [1, 5, 1, 3, 1], [1, 12, 2, 3, 1]. How should I intrepret these? I tried plotting them but my results are quiet different on the H36M dataset compared to the results on the project webpage.

For the transformer anchor points with shape [1, 1, 3, 3, 1], how would an xy pair be indexed?

CanKeles5 avatar Apr 12 '23 10:04 CanKeles5

You can interpret the dimensions like this: [batch, number_of_parts, anchor_number, xy(z), ()], where () are dimensions added for broadcasting matrix mutliplications. So the first tensor with shape [1,,1, 3, 3, 1] corresponds to the core, which consists of 3 anchors, where each one can be indexed via [0, 0, i, :2, 0]. I'm gonna add some code to make this more clear, it's quite confusing.

lschmidtke avatar Apr 12 '23 10:04 lschmidtke

I tried running inference on some H36M frames with the indexing you provided but the results I am getting are still not really meaningfull. I guess I am missing some pre processing steps. It would be really helpfull if you could share a script for inference.

Thank you for your time.

CanKeles5 avatar Apr 12 '23 20:04 CanKeles5

Hi,

I will update the repo, just need a little more time.

lschmidtke avatar Apr 25 '23 20:04 lschmidtke