{"id":20602625,"url":"https://github.com/bearpaw/pyranet","last_synced_at":"2025-10-25T10:12:04.145Z","repository":{"id":75852973,"uuid":"97566696","full_name":"bearpaw/PyraNet","owner":"bearpaw","description":"Code for \"Learning Feature Pyramids for Human Pose Estimation\" (ICCV 2017)","archived":false,"fork":false,"pushed_at":"2021-12-20T20:18:32.000Z","size":11581,"stargazers_count":222,"open_issues_count":11,"forks_count":58,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T22:22:05.493Z","etag":null,"topics":["human-pose-estimation"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-18T07:18:17.000Z","updated_at":"2024-12-19T15:14:11.000Z","dependencies_parsed_at":"2024-01-14T02:32:53.276Z","dependency_job_id":"db90a54e-f15d-450d-83fe-3f7249ef02bb","html_url":"https://github.com/bearpaw/PyraNet","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%2FPyraNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2FPyraNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2FPyraNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearpaw%2FPyraNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearpaw","download_url":"https://codeload.github.com/bearpaw/PyraNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252531882,"owners_count":21763293,"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":["human-pose-estimation"],"created_at":"2024-11-16T09:14:18.905Z","updated_at":"2025-10-25T10:12:04.079Z","avatar_url":"https://github.com/bearpaw.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning Feature Pyramids for Human Pose Estimation\n\nTraining and testing code for the paper \n\u003e **[Learning Feature Pyramids for Human Pose Estimation](https://arxiv.org/abs/1708.01101)**  \n\u003e Wei Yang, Shuang Li, Wanli Ouyang, Hongsheng Li, Xiaogang Wang  \n\u003e ICCV, 2017 \n\nThis code is based on [stacked hourglass networks](https://github.com/anewell/pose-hg-train) and [fb.resnet.torch](https://github.com/facebook/fb.resnet.torch). Thanks to the authors. \n\n## Install\n\n1. Install [Torch](http://torch.ch/).\n\n2. Install dependencies.\n   ```\n   luarocks install hdf5\n   luarocks install matio\n   luarocks install optnet\n   ```\n\n3. (Optional) Install nccl for better performance when training with multi-GPUs.\n   ```\n   git clone https://github.com/NVIDIA/nccl.git\n   cd nccl\n   make \n   make install\n   luarocks install nccl\n   ```\n   set `LD_LIBRARY_PATH` in file `~/.bashrc` if `libnccl.so` is not found.\n\n4. Prepare dataset.  \n   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   Create a symbolic link to the images directory of the LSP dataset (images are stored in `PATH_TO_LSP_DIR/images`):\n   ```\n   ln -s PATH_TO_LSP_DIR data/lsp/lsp_dataset\n   ```\n   Create a symbolic link to the images directory of the LSP extension dataset (images are stored in `PATH_TO_LSPEXT_DIR/images`):\n   ```\n   ln -s PATH_TO_LSPEXT_DIR data/lsp/lspet_dataset\n   ```\n\n## Training and Testing\n\n### Quick Start\n\n#### Testing from our pretrained model\nDownload our pretrained model to `./pretrained` folder from [Google Drive](https://drive.google.com/drive/folders/0B63t5HSgY4SQbmJoRV9fOTBFTlU?resourcekey=0-AT4Eik8SdlpF2nQ7vevbIg\u0026usp=sharing). Test on the MPII validation set by running the following command\n\n```\nqlua main.lua -batchSize 1 -nGPU 1 -nStack 8 -minusMean true -loadModel pretrained/model_250.t7 -testOnly true -debug true\n```\n\n![Example](data/example.png)\n\nFor multi-scale testing, run\n\n```\nqlua evalPyra.lua -batchSize 1 -nGPU 1 -nStack 8 -minusMean true -loadModel pretrained/model_250.t7 -testOnly true -debug true\n```\n\n**Note**: \n* If you DO NOT want to visualize the training results. Set `-debug false` and use `th` instead of `qlua`.\n* you may set the number of scales in `evalPyra.lua` (Line 22 ). Use fewer number of scales or multiple GPUs if \"out of memory\" occurs.\n* use `-loadModel MODEL_PATH` to load a specific model for testing or training\n\n#### Train a two-stack hourglass model \n\nTrain an example two-stack hourglass model on the MPII dataset with the proposed *Pyramids Residual Modules* (PRMs)\n\n```\nsh ./experiments/mpii/hg-prm-stack2.sh \n```\n\n### Customize your own training and testing procedure\n\nA sample script for training on the MPII dataset with 8-stack hourglass model.\n\n```bash\n#!/usr/bin/env sh\nexpID=mpii/mpii_hg8   # snapshots and log file will save in checkpoints/$expID\ndataset=mpii          # mpii | mpii-lsp | lsp |\ngpuID=0,1             # GPUs visible to program\nnGPU=2                # how many GPUs will be used to train the model\nbatchSize=16          \nLR=6.7e-4\nnetType=hg-prm        # network architecture\nnStack=2\nnResidual=1\nnThreads=4            # how many threads will be used to load data\nminusMean=true\nnClasses=16\nnEpochs=200           \nsnapshot=10           # save models for every $snapshot\n\nOMP_NUM_THREADS=1 CUDA_VISIBLE_DEVICES=$gpuID th main.lua \\\n   -dataset $dataset \\\n   -expID $expID \\\n   -batchSize $batchSize \\\n   -nGPU $nGPU \\\n   -LR $LR \\\n   -momentum 0.0 \\\n   -weightDecay 0.0 \\\n   -netType $netType \\\n   -nStack $nStack \\\n   -nResidual $nResidual \\\n   -nThreads $nThreads \\\n   -minusMean $minusMean \\\n   -nClasses $nClasses \\\n   -nEpochs $nEpochs \\\n   -snapshot $snapshot \\\n   # -resume checkpoints/$expID  \\  # uncomment this line to resume training\n   # -testOnly true \\               # uncomment this line to test on validation data\n   # -testRelease true \\            # uncomment this line to test on test data (MPII dataset)\n```\n\n\n## Evaluation\nYou may evaluate the PCKh score of your model on the MPII validation set. To get start, download our prediction `pred_multiscale_250.h5` to `./pretrained` from [Google Drive](https://drive.google.com/drive/folders/0B63t5HSgY4SQbmJoRV9fOTBFTlU?resourcekey=0-AT4Eik8SdlpF2nQ7vevbIg\u0026usp=sharing), and run the MATLAB script `evaluation/eval_PCKh.m`. You'll get the following results\n\n```\n      Head , Shoulder , Elbow , Wrist , Hip , Knee  , Ankle , Mean , \nname , 97.41 , 96.16 , 91.10 , 86.88 , 90.05 , 86.00 , 83.89 , 90.27\n```\n\n\n## Citation\nIf you find this code useful in your research, please consider citing:\n\n```\n@inproceedings{yang2017pyramid,\n    Title = {Learning Feature Pyramids for Human Pose Estimation},\n    Author = {Yang, Wei and Li, Shuang and Ouyang, Wanli and Li, Hongsheng and Wang, Xiaogang},\n    Booktitle = {arXiv preprint arXiv:1708.01101},\n    Year = {2017}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearpaw%2Fpyranet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearpaw%2Fpyranet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearpaw%2Fpyranet/lists"}