anibali / margipose

3D monocular human pose estimation
Apache License 2.0
98 stars 20 forks source link

Getting Margipose to run without docker #4

Closed afung-git closed 4 years ago

afung-git commented 5 years ago

Hi Aiden,

I am new to pytorch and would like to play around with the margipose code. Given the pre-trained model that you provide. How can I use it to make an inference on a single image? Any insight into the script that I can use would be really helpful!!

Thanks!

anibali commented 5 years ago

I've just added a single-image inference script in commit https://github.com/anibali/margipose/commit/f6154cd8c338546d3c5fbb846f2f7513ce578f77. All it does is run the specified image through a MargiPose model and show the normalised skeleton prediction in a GUI. Here's an example invocation of the new command:

./run.sh margipose infer --model margipose-mpi3d.pth --image man_running.jpg

Here is the man_running.jpg image I tested it with:

man_running

The result should look something like this:

Screenshot from 2019-04-24 09-57-12

Please note that there are some caveats to this script.

  1. The input image is assumed to be centred on a human subject, and scaled appropriately.
  2. Since camera intrinsics are not known, the skeleton is left in normalised form. This can lead to "warped"-looking skeletons in certain situations.
gearmlai commented 4 years ago

can i run it without any docker installation?

eg. infer --model margipose-mpi3d.pth --image man_running.jpg

anibali commented 4 years ago

@gearmlai Yes, as long as you have MargiPose and all of the dependencies set up correctly. Note that the command in that case would be:

margipose infer --model margipose-mpi3d.pth --image man_running.jpg