Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing the keypoints #9

Open
CanKeles5 opened this issue Apr 5, 2023 · 5 comments
Open

Visualizing the keypoints #9

CanKeles5 opened this issue Apr 5, 2023 · 5 comments

Comments

@CanKeles5
Copy link

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

@lschmidtke
Copy link
Owner

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.

@CanKeles5
Copy link
Author

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?

@lschmidtke
Copy link
Owner

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.

@CanKeles5
Copy link
Author

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.

@lschmidtke
Copy link
Owner

Hi,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants