Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
653 stars 137 forks source link

Question about Integrating with existing C++ Project #82

Closed adammpolak closed 2 years ago

adammpolak commented 2 years ago

@Daniil-Osokin hello!

Thank you for this phenomenal work!

I have an existing C++ project that is using OpenVINO to run inference. I would like to also include this model in the C++ project.

I have followed the instructions and ran:

python setup.py build_ext
export PYTHONPATH=pose_extractor/build/:$PYTHONPATH

and I have my pose_extractor folder: image

Forgive me if this a dumb question but what do I need to do to get this integrated with my existing C++ project?

From the "hello_classification" example from OpenVINO, at what point would I need to run the pose_extractor?: image

Could I include the source C++ files in my project? Once I run the OpenVINO reference, what do I need to call on the results in order to output the 3D poses? I see in python it runs parse_poses on the inference results, I would need to do the same but in C++, what function should I call? (there doesn't seem to be parse_poses function in C++)

Daniil-Osokin commented 2 years ago

Hi! I believe the easiest way will be rewrite Python code of parse_poses to C++. C++ files of pose_extractor you can use as is in your project.

adammpolak commented 2 years ago

Thank you for your speedy response! I was hoping I could double check I got this right.

It seems like the python functions that must be re-written in order to rewrite parse_poses are:

  1. parse_poses
    1. get_root_relative_poses (used in parse_poses)
    2. propagate_ids (used in parse_poses)
    3. get_similarity (used in propogate_ids)

and I could use the extractPoses from C++

Is that correct?

Daniil-Osokin commented 2 years ago

Think so, everything is inside parse_poses.

Daniil-Osokin commented 2 years ago

Hope, it helped.

adammpolak commented 2 years ago

Thank you @Daniil-Osokin !