CMU-Perceptual-Computing-Lab / openpose

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation
https://cmu-perceptual-computing-lab.github.io/openpose
Other
30.84k stars 7.83k forks source link

[QUESTION] When executing openpose Python API examples09:~/openpose/build/examples/tutorial_api_python/09_keypoints_from_heatmaps.py #1762

Open Pinocchioo opened 3 years ago

Pinocchioo commented 3 years ago

ubuntu:20.04,cuda:10.02,cudnn:7.6.5,python:3.6.12 installed by conda,cmake:3.16.3, Pybind11 module report errors when executing openpose Python API examples09:09_keypoints_from_heatmaps.py.The error report is as follows:

Starting OpenPose Python Wrapper...
Auto-detecting all available GPUs... Detected 1 GPU(s), using 1 of them starting at GPU 0.
emplaceAndPop(): incompatible function arguments. The following argument types are supported:
    1. (self: openpose.pyopenpose.WrapperPython, arg0: std::vector<std::shared_ptr<op::Datum>, std::allocator<std::shared_ptr<op::Datum> > >) -> bool

Invoked with: <openpose.pyopenpose.WrapperPython object at 0x7fab91920e30>, [<openpose.pyopenpose.Datum object at 0x7fab91920fb8>]

Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,
<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic
conversions are optional and require extra headers to be included
when compiling your pybind11 module.

I compile the library by cmake —— make -j —— make install the source code that git clone from the openpose git. After installing the openpose library, I ran the python API example and reported an error. cmake-gui: What I modified is:

BUILD_PYTHON ON
Add_Entry:
PYTHON_EXECUTABLE = /home/pinocchio/anaconda3/envs/openpose/bin/python3.6m
PYTHON_LIBRARY = 
/home/pinocchio/anaconda3/envs/openpose/lib/libpython3.6m.so

I didn't make any changes to the source code. I just installed the library, and ran the example. And I don't know why ,I hope someone can answer it. Thank you very much.

Pinocchioo commented 3 years ago

I met this problem in latest openpose V1.7 from git downloading. Now this problem has been solved, after I downloaded the v1.6 relsaseed version of the openpose. So I think the official examples have some wrong place in latest openpose_python_api example_09.

Pinocchioo commented 3 years ago

And someone had also met this problem. https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1718

sunshinnnn commented 3 years ago

After changing openpose from 1.7 to 1.6, python api works finally. Thanks! :)

soulslicer commented 3 years ago

Are you sure, I just got the latest version from master, and running:

python3 08_heatmaps_from_image.py

works for me

@gineshidalgo99 Is V1.7 referencing current master?

Pinocchioo commented 3 years ago

Are you sure, I just got the latest version from master, and running:

python3 08_heatmaps_from_image.py

works for me

@gineshidalgo99 Is V1.7 referencing current master?

What the problem I met is :

python 09_keypoints_from_heatmaps.py

And python 08_heatmaps_from_image.py in V1.7 latest is also works for me.

soulslicer commented 3 years ago

Yes, you are right.

Line 58 is suppose to be:

opWrapper.emplaceAndPop(op.VectorDatum([datum]))

Would you like the opportunity to make a PR, or shall i push the fix

Pinocchioo commented 3 years ago

Yes, you are right.

Line 58 is suppose to be:

opWrapper.emplaceAndPop(op.VectorDatum([datum]))

Would you like the opportunity to make a PR, or shall i push the fix

My Pr: https://github.com/CMU-Perceptual-Computing-Lab/openpose/pull/1794 But it report error , maybeopWrapper.emplaceAndPop(op.VectorDatum([datum])) is incorrect .

soulslicer commented 3 years ago

Yes, you are right. Line 58 is suppose to be:

opWrapper.emplaceAndPop(op.VectorDatum([datum]))

Would you like the opportunity to make a PR, or shall i push the fix

My Pr:

1794

But it report error , maybeopWrapper.emplaceAndPop(op.VectorDatum([datum])) is incorrect .

Hmm that's not possible. I literally just tested it last week. What error do you get

Deeperfinder commented 3 years ago

I meet this problem too,and i replace code opWrapper.emplaceAndPop([datum]) to opWrapper.emplaceAndPop(op.VectorDatum([datum])) ,then everythings going well.

zxwblublu commented 3 years ago

I meet this problem too,and i replace code opWrapper.emplaceAndPop([datum]) to opWrapper.emplaceAndPop(op.VectorDatum([datum])) ,then everythings going well.

thank u ! u fix my problem!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.