{"id":20602622,"url":"https://github.com/bearpaw/pytorch-pose","last_synced_at":"2025-05-16T11:03:49.283Z","repository":{"id":43042679,"uuid":"90028126","full_name":"bearpaw/pytorch-pose","owner":"bearpaw","description":"A PyTorch toolkit for 2D Human Pose Estimation.","archived":false,"fork":false,"pushed_at":"2021-12-20T20:15:47.000Z","size":7031,"stargazers_count":1118,"open_issues_count":32,"forks_count":253,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-09T06:06:46.851Z","etag":null,"topics":["hourglass-network","human-pose-estimation","mpii-dataset","mscoco-keypoint","pose","pose-estimation","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bearpaw.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}},"created_at":"2017-05-02T11:53:52.000Z","updated_at":"2025-03-28T12:02:25.000Z","dependencies_parsed_at":"2022-09-23T17:51:30.197Z","dependency_job_id":null,"html_url":"https://github.com/bearpaw/pytorch-pose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2Fpytorch-pose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2Fpytorch-pose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2Fpytorch-pose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2Fpytorch-pose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearpaw","download_url":"https://codeload.github.com/bearpaw/pytorch-pose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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":["hourglass-network","human-pose-estimation","mpii-dataset","mscoco-keypoint","pose","pose-estimation","pytorch"],"created_at":"2024-11-16T09:14:18.336Z","updated_at":"2025-05-16T11:03:49.260Z","avatar_url":"https://github.com/bearpaw.png","language":"Python","funding_links":[],"categories":["Popular implementations","🛠️ Tools \u0026 Libraries","Paper implementations｜论文实现","Paper implementations"],"sub_categories":["PyTorch","🧰 Specialized Libraries","Other libraries｜其他库:","Other libraries:"],"readme":"# PyTorch-Pose\n\n![screenshot](./docs/screenshot.png)\n\nPyTorch-Pose is a PyTorch implementation of the general pipeline for 2D single human pose estimation. The aim is to provide the interface of the training/inference/evaluation, and the dataloader with various data augmentation options for the most popular human pose databases (e.g., [the MPII human pose](http://human-pose.mpi-inf.mpg.de), [LSP](http://www.comp.leeds.ac.uk/mat4saj/lsp.html) and [FLIC](http://bensapp.github.io/flic-dataset.html)).\n\nSome codes for data preparation and augmentation are brought from the [Stacked hourglass network](https://github.com/anewell/pose-hg-train). Thanks to the original author.\n\n**Update: this repository is compatible with PyTorch 0.4.1/1.0 now!**\n\n## Features\n- Multi-thread data loading\n- Multi-GPU training\n- Logger\n- Training/testing results visualization\n\n## Installation\n1. PyTorch (\u003e= 0.4.1): Please follow the [installation instruction of PyTorch](http://pytorch.org/). Note that the code is developed with Python2 and has not been tested with Python3 yet.\n\n2. Clone the repository with submodule\n   ```\n   git clone --recursive https://github.com/bearpaw/pytorch-pose.git\n   ```\n\n3. Create a symbolic link to the `images` directory of the MPII dataset:\n   ```\n   ln -s PATH_TO_MPII_IMAGES_DIR data/mpii/images\n   ```\n   For training/testing on COCO, please refer to [COCO Readme](https://github.com/bearpaw/pytorch-pose/blob/master/data/mscoco/README.md).\n\n\u003c!-- 4. Modify your `.bashrc` file:\n   ```\n   export PYTHONPATH=\".:$PYTHONPATH\"\n   ``` --\u003e\n\n4. Download annotation file:\n    * (MPII) Download [mpii_annotations.json](https://drive.google.com/open?id=1mQrH_yVHeB93rzCfyq5kC9ZYTwZeMsMm) and save it to `data/mpii`\n    * (MSCOCO) Download [coco_annotations_2014.json](https://drive.google.com/open?id=1jrxis4ujrLlkwoD2GOdv3PGzygpQ04k7) or/and [coco_annotations_2017.json](https://drive.google.com/open?id=1YuzpScAfzemwZqUuZBrbBZdoplXEqUse) and save it to `data/mscoco`\n\n## Usage\n\n**Please refer to [TRAINING.md](TRAINING.md) for detailed training recipes!**\n\n### Testing\nYou may download our pretrained models (e.g., [2-stack hourglass model](https://drive.google.com/drive/folders/0B63t5HSgY4SQQ2FBRE5rQ2EzbjQ?resourcekey=0-EyrDJs1JYnC5byj5GydbPQ\u0026usp=sharing)) for a quick start.\n\nRun the following command in terminal to evaluate the model on MPII validation split (The train/val split is from [Tompson et al. CVPR 2015](http://www.cims.nyu.edu/~tompson/data/mpii_valid_pred.zip)).\n```\nCUDA_VISIBLE_DEVICES=0 python example/main.py --dataset mpii -a hg --stacks 2 --blocks 1 --checkpoint checkpoint/mpii/hg_s2_b1 --resume checkpoint/mpii/hg_s2_b1/model_best.pth.tar -e -d\n```\n* `-a` specifies a network architecture\n* `--resume` will load the weight from a specific model\n* `-e` stands for evaluation only\n* `-d` will visualize the network output. It can be also used during training\n\nThe result will be saved as a `.mat` file (`preds_valid.mat`), which is a `2958x16x2` matrix, in the folder specified by `--checkpoint`.\n\n#### Evaluate the PCKh@0.5 score\n\n##### Evaluate with MATLAB\n\nYou may use the matlab script `evaluation/eval_PCKh.m` to evaluate your predictions. The evaluation code is ported from  [Tompson et al. CVPR 2015](http://www.cims.nyu.edu/~tompson/data/mpii_valid_pred.zip).\n\nThe results (PCKh@0.5 score) trained using this code is reported in the following table.\n\n\n| Model            | Head | Shoulder | Elbow | Wrist | Hip  | Knee  | Ankle | Mean |\n| ---------------- | -----| -------- | ----- | ----- | ---- | ------|------ | ---- |\n| hg_s2_b1 (last)  | 95.80| 94.57    | 88.12 | 83.31 | 86.24| 80.88 | 77.44 | 86.76|\n| hg_s2_b1 (best)  | 95.87| 94.68    | 88.27 | 83.64 | 86.29| 81.20 | 77.70 | 86.95|\n| hg_s8_b1 (last)  | 96.79| 95.19    | 90.08 | 85.32 | 87.48| 84.26 | 80.73 | 88.64|\n| hg_s8_b1 (best)  | 96.79|\t95.28\t   | 90.27 | 85.56 | 87.57| 84.3  | 81.06\t| 88.78|\n\nTraining / validation curve is visualized as follows.\n\n![curve](data/acc_curve.png)\n##### Evaluate with Python\n\nYou may also evaluate the result by running `python evaluation/eval_PCKh.py` to evaluate the predictions. It will produce exactly the same result as that of the MATLAB. Thanks [@sssruhan1](https://github.com/sssruhan1) for the [contribution](https://github.com/bearpaw/pytorch-pose/pull/2).\n\n### Training\nRun the following command in terminal to train an 8-stack of hourglass network on the MPII human pose dataset.\n```\nCUDA_VISIBLE_DEVICES=0 python example/main.py --dataset mpii -a hg --stacks 8 --blocks 1 --checkpoint checkpoint/mpii/hg8 -j 4\n```\nHere,\n* `CUDA_VISIBLE_DEVICES=0` identifies the GPU devices you want to use. For example, use `CUDA_VISIBLE_DEVICES=0,1` if you want to use two GPUs with ID `0` and `1`.\n* `-j` specifies how many workers you want to use for data loading.\n* `--checkpoint` specifies where you want to save the models, the log and the predictions to.\n\n## Miscs\nSupported dataset\n- [x] [MPII human pose](http://human-pose.mpi-inf.mpg.de)\n- [x] [Leeds Sports Pose (LSP)](http://sam.johnson.io/research/lsp.html)\n- [x] [MSCOCO (single person)](http://cocodataset.org/#keypoints-challenge2017)\n\nSupported models\n- [x] [Stacked Hourglass networks](https://arxiv.org/abs/1603.06937)\n- [x] Xiao et al., Simple Baselines for Human Pose Estimation and Tracking, ECCV 2018 ([PDF](https://arxiv.org/abs/1804.06208) | [GitHub](https://github.com/Microsoft/human-pose-estimation.pytorch))\n\n## Contribute\nPlease create a pull request if you want to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearpaw%2Fpytorch-pose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearpaw%2Fpytorch-pose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearpaw%2Fpytorch-pose/lists"}