Skip to main content

Lightweight whole-body pose estimator (coords only) refactored from IDEA-Research/DWPose

Project description

DWPose

Lightweight whole-body pose estimator (coords only) refactored from IDEA-Research/DWPose

Install

pip install dwposes

Usage

from PIL import Image
from DWPoses import DWposeDetector
model = DWposeDetector()
img = Image.open("path/to/image.png", return_img=True)
pose, imgout = model.predict(img)
# imgout is a PIL image with pose drawn on it
imgout.save("openpose.png")
# pose is a dictionary with keys [bodies, hands, faces, foot]
print(pose)

Alternatively, you can load with cv2 and numpy:

import cv2
img = cv2.imread("path/to/image.png")
pose, imgout = model.predict(img)
# imgout is a numpy array with pose drawn on it, BGR format
imgout = cv2.cvtColor(imgout, cv2.COLOR_BGR2RGB)
imgout = Image.fromarray(imgout)
imgout.save("openpose.png")

Alternatively, you can specify the model path to the file yolox_l.onnx and dw-ll_ucoco_384.onnx:

model = DWposeDetector(det="path/to/yolox_l.onnx", pose="path/to/dw-ll_ucoco_384.onnx")
pose, imgOut = model(img, return_img=True)
if isinstance(imgOut, np.ndarray):
    imgOut = cv2.cvtColor(imgOut, cv2.COLOR_BGR2RGB)
    imgOut = Image.fromarray(imgOut)
imgOut.save("openpose.png")
print(pose)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwposes-0.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwposes-0.1.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file dwposes-0.1.0.tar.gz.

File metadata

  • Download URL: dwposes-0.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.7

File hashes

Hashes for dwposes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f91fc0585b03a53533fdfed7e8197bc2876efc7949d0924014e3d61f3e926ef
MD5 1f65abff1c7583292db3f8d1faa9ad95
BLAKE2b-256 1e56290c9c865f10d46baaa4e669ab131c1159f941d07f02c9a54671878a8f22

See more details on using hashes here.

File details

Details for the file dwposes-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dwposes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.7

File hashes

Hashes for dwposes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91f692d986864061434df2e88231d0fd416e3e9e47de2642f363163d8dc997b3
MD5 a780034427a338ee840d5d84248c9049
BLAKE2b-256 09adc513ebf85bbfc65791cd72c6c72e8a7a681b0f9bfc713d090df374a7dab2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page