OpenPose Python API (Pyopenpose)

Cont.

Openpose (Python API) Notes

PATH

 # Import Openpose (Windows/Ubuntu/OSX)
    dir_path = os.path.dirname(os.path.realpath(__file__))
    try:
        # Change these variables to point to the correct folder (Release/x64 etc.)
        # sys.path.append(dir_path + '/../bin/python/openpose/Release');
        # os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../x64/Release;' + dir_path + '/../bin;'

        sys.path.append(r'C:\Users\workspace\Desktop\openpose\bin\python\openpose\Release')
        os.environ['PATH'] = os.environ['PATH'] + ';' + r'C:\Users\woekspace\Desktop\openpose\bin'
        import pyopenpose as op
    except ImportError as e:
        print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?')
        raise e

OpenPose Python API (Pyopenpose)_第1张图片
OpenPose Python API (Pyopenpose)_第2张图片
两处要改

  • system.path.append
  • os.environ[path]

To 设置系统环境变量
(sys.path.append
即list.append)
OpenPose Python API (Pyopenpose)_第3张图片

OpenPose Python API (Pyopenpose)_第4张图片

分号 :说明是两个path

Env

OpenPose Python API (Pyopenpose)_第5张图片
系统默认的interpreter是3.8
openpose依赖有pytorch,这个默认3.8没有pytorch,所以需改为3.7

Error

OpenPose Python API (Pyopenpose)_第6张图片

  • 有一个caffe trained model没找到

OpenPose Python API (Pyopenpose)_第7张图片

  • opencv抛出错误,图也没找到,即imshow(None无东西)

Done之后发现欧了
OpenPose Python API (Pyopenpose)_第8张图片

Continue to explore……

你可能感兴趣的:(CV(Computer,Vision),#,OpenPose,#,OpenCV,python,计算机视觉)