{"id":19816003,"url":"https://github.com/replicate/cog-dwpose","last_synced_at":"2025-09-18T06:32:36.353Z","repository":{"id":219798302,"uuid":"749925156","full_name":"replicate/cog-dwpose","owner":"replicate","description":"Cog wrapper for DWPose","archived":false,"fork":false,"pushed_at":"2024-01-29T17:15:31.000Z","size":4687,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-05T22:06:34.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replicate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-29T17:03:17.000Z","updated_at":"2024-11-26T21:51:42.000Z","dependencies_parsed_at":"2024-01-29T21:35:47.299Z","dependency_job_id":null,"html_url":"https://github.com/replicate/cog-dwpose","commit_stats":null,"previous_names":["replicate/cog-dwpose"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-dwpose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-dwpose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-dwpose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-dwpose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/cog-dwpose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233456046,"owners_count":18678965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:08:00.719Z","updated_at":"2025-09-18T06:32:30.726Z","avatar_url":"https://github.com/replicate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Cog wrapper for DWPose\nCog wrapper for DWPose, a whole body pose estimation model that detects 2D body, hands and face keypoints of multiple people in images. Refer to the [paper](https://arxiv.org/abs/2307.15880) and original [repo](https://github.com/IDEA-Research/DWPose) for details.\n\n\n## Using the API\nYou need to have Cog and Docker installed to run this model locally. You also need to download thee pose model dw-ll_ucoco_384.onnx ([baidu](https://pan.baidu.com/s/1nuBjw-KKSxD_BkpmwXUJiw?pwd=28d7), [google](https://drive.google.com/file/d/12L8E2oAgZy4VACGSK9RaZBZrfgx7VTA2/view?usp=sharing)) and detection model yolox_l.onnx ([baidu](https://pan.baidu.com/s/1fpfIVpv5ypo4c1bUlzkMYQ?pwd=mjdn), [google](https://drive.google.com/file/d/1w9pXC8tT0p9ndMN-CArp1__b2GbzewWI/view?usp=sharing)), and place them under the annotator/ckpts folder.\n\n\nTo use the DWPose, simply upload an image and set the threshold to filter out low probability detections. The API outputs an *.npz* file with keypoint detections for each person in the image, and a plot of detected keypoints overlaid on the image. \n\nTo build the docker image with cog and run a prediction:\n```bash\ncog predict -i image=@test_images/running.jpeg -i threshold=0.3\n```\n\nTo start a server and send requests to your locally or remotely deployed API:\n```bash\ncog run -p 5000 python -m cog.server.http\n```\n\nThe output .npz file is organized as follows:\n```\n{\n    \"person_0\": {\n        \"body\": np.array of shape (18, 2),\n        \"face\": np.array of shape (68, 2),\n        \"hands\": np.array of shape (2, 21, 2),\n    },\n    \"person_1\": {\n        \"body\": np.array of shape (18, 2),\n        \"face\": np.array of shape (68, 2),\n        \"hands\": np.array of shape (2, 21, 2),\n    },\n   ..\n}\n```\nKeypoints are given as relative (x, y) coordinates and independent of image size. DWPose returns 18 body keypoints, 68 face keypoints and 21 hand keypoints per hand.\n\n```\nimport numpy as np\n\n# load keypoints\ndata = np.load(\"result.npz\", allow_pickle=True)\n\n# number of detected people\nnum_people = len(data.files)\n\n# body, face, hands keypoints of person_0\nperson_0 = data[\"person_0\"].item()\nbody_kpts = person_0[\"body\"] \nface_kpts = person_0[\"face\"] \nhands_kpts = person_0[\"hands\"] \n```\n\n## References\n```\n@inproceedings{yang2023effective,\n  title={Effective whole-body pose estimation with two-stages distillation},\n  author={Yang, Zhendong and Zeng, Ailing and Yuan, Chun and Li, Yu},\n  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},\n  pages={4210--4220},\n  year={2023}\n} \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fcog-dwpose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Fcog-dwpose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fcog-dwpose/lists"}