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

Faster pytorch batched version. #11

Merged
merged 2 commits into from Feb 2, 2019
Merged

Conversation

sebftw
Copy link
Contributor

@sebftw sebftw commented Feb 1, 2019

I made this very fast pytorch implementation of your SMPL model for my work with the SMIL model.
It took me all of monday, and then it turned out you had already made a pytorch version when I was done with my code. :)
I believe this should work with both the SMPL and SMIL model. It is very very fast on my computer, only limited by the memory, and it works with sparse tensors too! (Saving a lot of said memory)
I hope my code is not too messy, I don't have time to clean it up, but I hope it is helpful to you.
Try it out!

Thank you so much for your work, it helped me a lot.
SMIL: https://www.iosb.fraunhofer.de/servlet/is/82920/

If you have any questions feel free to ask.
Best regards, Sebastian.

PS: I gave up on making the model able to be loaded from a state dict. It turns out that you have to know the shape of the parameters/buffers for this to be possible.

I made this very fast pytorch implementation of your SMPL model for my work with the SMIL model.
It took me all of monday, and then it turned out you had already made a pytorch version when I was done with my code. :)
I believe this should work with both the SMPL and SMIL model. It is very very fast on my computer, only limited by the memory, and it works with sparse tensors too! (Saving a lot of said memory)
I hope my code is not too messy, I don't have time to clean it up but I hope it is helpful to you.
Try it out!

Thank you so much for your work, it helped me a lot.
SMIL: https://www.iosb.fraunhofer.de/servlet/is/82920/

If you have any questions feel free to ask.
Best regards, Sebastian.
Now it is made possible to give None as model_path, which means it should not load the model.
Then you can instead load from a state dict. This state dict must contain 'kintree_table', but otherwise partial loading is also possible.

See https://pytorch.org/tutorials/beginner/saving_loading_models.html for examples.
@CalciferZh CalciferZh merged commit 6ab21ed into CalciferZh:master Feb 2, 2019
@CalciferZh
Copy link
Owner

Should we change the name of this repo? Since now we also support SMIL model.

@Lotayou
Copy link
Contributor

Lotayou commented Feb 2, 2019

@sebftw Thanks for your work! However I cannot find smil_np inside the repo, can you tell me how to run the test script? Thanks!

@sebftw
Copy link
Contributor Author

sebftw commented Feb 2, 2019

You can replace it with smpl_np. 🙂 It is agnostic to which of the two models you use.

@sebftw sebftw deleted the patch-1 branch February 2, 2019 16:29
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

Successfully merging this pull request may close these issues.

None yet

3 participants