- Notifications
You must be signed in to change notification settings - Fork43
Preprocessor for OpenPose ControlNet
License
reallyigor/easy_dwpose
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Recently, I tried to inference the DWPose (improved OpenPose) preprocessor forDiffusers and was shocked by how complicated it actually is!So, I decided to change that!
The goal of Easy DWPose is to provide a generic, reliable, and easy-to-use interface for making skeletons for ControlNet.
- Easy installation!
- Automatic checkpoint downloading.
- Generic class to either import in Jupyter or to run on a video/images.
- Code that is easy to read and modify.
- Choose GPU for multi-gpu inference!
- Custom drawing functions: convenient interface for modifyinghow you draw skeletons.
pip install easy-dwpose
git clone git@github.com:reallyigor/easy_dwpose.gitcd easy_dwposepip install -e.
importtorchfromPILimportImagefromeasy_dwposeimportDWposeDetector# You can use a different GPU, e.g. "cuda:1"device="cuda:0"iftorch.cuda.is_available()else"cpu"detector=DWposeDetector(device=device)input_image=Image.open("assets/pose.png").convert("RGB")skeleton=detector(input_image,output_type="pil",include_hands=True,include_face=True)skeleton.save("skeleton.png")
| Input | Output |
|---|---|
![]() | ![]() |
python scripts/inference_on_video.py --input assets/dance.mp4 --output_path result.mp4
| Input | Output |
|---|---|
![]() | ![]() |
python scripts/inference_on_folder.py --input assets/ --output_path results/
By default, we use standart skeleton drawing function but several projects change it (e.g.MusePose). Modify it or write your own from scratch!
fromPILimportImagefromeasy_dwposeimportDWposeDetectorfromeasy_dwpose.draw.museposeimportdraw_poseasdraw_pose_museposedetector=DWposeDetector(device="cpu")input_image=Image.open("assets/pose.png").convert("RGB")skeleton=detector(input_image,output_type="pil",draw_pose=draw_pose_musepose,draw_face=False)skeleton.save("skeleton.png")
We thank the original authors of theDWPose for their incredible models!
Thanks for open-sourcing!
About
Preprocessor for OpenPose ControlNet
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.



