Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
/ openpose-python Public archive

Pre-built OpenPose packages with cuda for Python.

License

Notifications You must be signed in to change notification settings

ZWhitey/openpose-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openpose Python

Build status

Unofficial pre-built OpenPose packages with cuda for Python.

This package only test on windows 10 with python 3.6

Installaion

Prerequisites:

  • Python 3.5+
  • Numpy
  • OpenCV
  • Windows x64
  • Nvidia GPU

Installaion:

  • Python library
    1. Download whl file from release page
    2. Run pip install WHL_FILE_NAME to install
  • Openpose models
    1. Clone OpenPose
    2. Run ./models/getModels.bat to download models

Usage

This code is based on OpenPose python tutorial 01

# From Python
# It requires OpenCV installed for Python
import sys
import cv2
import pyopenpose as op

# Custom Params (refer to include/openpose/flags.hpp for more parameters)
params = dict()
params["model_folder"] = "YOUR_MODELS_PATH"

try:
    # Starting OpenPose
    opWrapper = op.WrapperPython()
    opWrapper.configure(params)
    opWrapper.start()

    datum = op.Datum()
    imageToProcess = cv2.imread('YOUR_IMAGE_PATH')
    datum.cvInputData = imageToProcess
    opWrapper.emplaceAndPop([datum])
    print("Body keypoints: \n" + str(datum.poseKeypoints))
    cv2.imshow("OpenPose 1.5.1 - Tutorial Python API", datum.cvOutputData)
    cv2.waitKey(0)
    
except Exception as e:
    print(e)
    sys.exit(-1)

More detailed information can be find in OpenPose Official Repository

Todo

  • Support other OS (linux, mac)
  • Support OpenCL and CPU version
  • Create lite version(without dll) and upload to pypi