Skip to main content

Easy DWPose Detector

Project description

PyPI

Easy DWPose Detector

Effective Whole-body Pose Estimation with Two-stages Distillation

DWPose official

Installation

#need install pytorch for your platform
#pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip3 install onnxruntime==1.13.1
pip3 onnxruntime_gpu==1.13.1
pip3 install matplotlib==3.6.2
pip3 install opencv_python==4.7.0.68
pip3 install scipy==1.11.4
pip3 install scikit_image==0.19.3
pip3 install huggingface_hub==0.20.1 
pip3 install dwpose

Easy to use

import json
import os
from dwpose import DwposeDetector
from PIL import Image

#if u need proxy
#os.environ['http_proxy'] = "http://127.0.0.1:1080"
#os.environ['https_proxy'] = "http://127.0.0.1:1080"

img = Image.open("test.jpg") #your image file

from dwpose import DwposeDetector
model = DwposeDetector.from_pretrained_default()
imgOut,j,source = model(img,
    include_hand=True,
    include_face=True,
    include_body=True,
    image_and_json=True,
    detect_resolution=512)

#openpose json
f = open("keypoints.json","w")
f.write(json.dumps(j))
f.close()

#openpose image
imgOut.save("openpose.jpg")

#detected resolution image
source.save("source.jpg")

del model

References

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

dwpose-1.0.0.tar.gz (36.6 kB view hashes)

Uploaded Source

Built Distribution

dwpose-1.0.0-py3-none-any.whl (45.1 kB view hashes)

Uploaded Python 3

Supported by

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