open_model_zoo icon indicating copy to clipboard operation
open_model_zoo copied to clipboard

Why do python interfaces use shared library modules written in C++ instead of separate python code

Open spencergotowork opened this issue 3 years ago • 3 comments

I have a question, why do python interfaces use shared library modules written in C++ instead of separate python code.

image Like this one, [human_pose_estimation_3d_demo] 's pose_extractor module. Or where can I get code written in Python? I mean, models like Pose 3D. Because to use them cross-platform, I had to recompile them instead of using them directly.

spencergotowork avatar Jun 19 '22 09:06 spencergotowork

it is common optimization practice to use C++ compiled modules to speed up heavy calculations. This shared library contains the code for localization pose points from 3d mesh grid, pure python realization will be very slow...

eaidova avatar Jun 19 '22 13:06 eaidova

it is common optimization practice to use C++ compiled modules to speed up heavy calculations. This shared library contains the code for localization pose points from 3d mesh grid, pure python realization will be very slow...

Thanks for your reply. Is there a better cross-platform solution if I use them on Jupyter Notebook? Now I have to compile a copy on the host machine if I want to use them.

spencergotowork avatar Jun 22 '22 02:06 spencergotowork

Sorry, the code written only for demonstration purposes, it is not ready to use solution and moreover without any intention to use it as cross-platform code. You can try to create wheel from this lib for your purposes and install it or rewrite in convenient for you way. Beside that, there is also simple realization of model adapter in accuracy checker in python (but may have not full functionality available in demo), you can try to use it as reference

eaidova avatar Jun 22 '22 05:06 eaidova