3

I recently needed to work on visual computing, and I went through OpenPose, which looks like a promising tool.
GitHub link to OpenPose by CMU Perceptual Computing Lab

As I'm working on a Windows 10 and developing with Python 3.7.5 (I use other libraries that require Python<3.8), I followed the instruction given for Windows.
So at first, I used the "lazy way": just download the pre-built version v1.7.0, extract it, and execute the model/getBaseModels.bat script and everything went fine. I can even run the examples from the examples directory.

But the condition is to execute python in this directory, because in the source code of the *.py (which works fine, again), we can find this code:

sys.path.append(dir_path + '/../bin/python/openpose/Release');
os.environ['PATH']  = os.environ['PATH'] + ';' + dir_path + '/../x64/Release;' +  dir_path + '/../bin;'
import pyopenpose as op

Instead of a simple and clear
import pyopenpose as op
(And I find it strange that even the examples are using a workaround)

The reason is simply that in the folder ..\binwe find about 90 DLL and in ..\bin\python\openpose\Release\ we find those 3 files:

  • pyopenpose.cp37-win_amd64.pyd
  • pyopenpose.exp
  • pyopenpose.lib

To be sure, I copied one script in a completely different folder, copied also the DLL and the 3 last files. In this case, if I run import pyopenpose with python, I get no error but I cannot run the example scripts (for example, module 'pyopenpose' has no attribute 'WrapperPython').
But I don't want to have to include all the 90 DLL for each project I make.

So I guess if all of these files were stored in the Python installation directory, like any package installed by pip, I could import all this with a simple import pyopenpose.

So my question is: What is the good way to install the pyopenpose package once we've downloaded it?


Additional information: by "curiosity", I also tried to go build the project with CMake, but, of course, the result is the same. I don't know much about CMake, but I thought that the issue could be bypassed by changing some parameters, like turning off the BUILD_SHARED_LIBS for example. But that wasn't very smart...


Additional question: I have to also install it on the Ubuntu I have at work, and I have the same problem. Would the solution be the same?

Marco
  • 196
  • 1
  • 1
  • 12

0 Answers0