{"id":15628443,"url":"https://github.com/rwightman/posenet-pytorch","last_synced_at":"2025-04-06T10:14:09.302Z","repository":{"id":41384305,"uuid":"165309124","full_name":"rwightman/posenet-pytorch","owner":"rwightman","description":"A PyTorch port of Google TensorFlow.js PoseNet (Real-time Human Pose Estimation)","archived":false,"fork":false,"pushed_at":"2023-06-08T17:12:14.000Z","size":39,"stargazers_count":308,"open_issues_count":5,"forks_count":99,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-30T09:08:49.204Z","etag":null,"topics":["deep-learning","human-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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwightman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"publiccode":null,"codemeta":null}},"created_at":"2019-01-11T21:01:15.000Z","updated_at":"2025-03-15T10:18:33.000Z","dependencies_parsed_at":"2024-10-23T00:36:52.643Z","dependency_job_id":null,"html_url":"https://github.com/rwightman/posenet-pytorch","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/rwightman%2Fposenet-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fposenet-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fposenet-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwightman%2Fposenet-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwightman","download_url":"https://codeload.github.com/rwightman/posenet-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464226,"owners_count":20942970,"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":["deep-learning","human-pose-estimation","pytorch"],"created_at":"2024-10-03T10:22:40.396Z","updated_at":"2025-04-06T10:14:09.281Z","avatar_url":"https://github.com/rwightman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PoseNet Pytorch\n\n**NOTE: This repository is no longer being maintained, please visit [Michelle Chan's](https://github.com/michellelychan) version at https://github.com/michellelychan/posenet-pytorch. She is adding training/fine-tune code, annotation tools, a streamlit app, and more.**\n\nThis repository contains a PyTorch implementation (multi-pose only) of the Google TensorFlow.js Posenet model.\n\nThis port is based on my Tensorflow Python (https://github.com/rwightman/posenet-python) conversion of the same model. An additional step of the algorithm was performed on the GPU in this implementation so it is faster and consumes less CPU (but more GPU). On a GTX 1080 Ti (or better) it can run over 130fps.\n\nFurther optimization is possible as the MobileNet base models have a throughput of 200-300 fps.\n\n### Install\n\nA suitable Python 3.x environment with a recent version of PyTorch is required. Development and testing was done with Python 3.7.1 and PyTorch 1.0 w/ CUDA10 from Conda.\n\nIf you want to use the webcam demo, a pip version of opencv (`pip install python-opencv=3.4.5.20`) is required instead of the conda version. Anaconda's default opencv does not include ffpmeg/VideoCapture support. The python bindings for OpenCV 4.0 currently have a broken impl of drawKeypoints so please force install a 3.4.x version.\n\nA fresh conda Python 3.6/3.7 environment with the following installs should suffice: \n```\nconda install -c pytorch pytorch cudatoolkit\npip install requests opencv-python==3.4.5.20\n```\n\n### Usage\n\nThere are three demo apps in the root that utilize the PoseNet model. They are very basic and could definitely be improved.\n\nThe first time these apps are run (or the library is used) model weights will be downloaded from the TensorFlow.js version and converted on the fly.\n\nFor all demos, the model can be specified with the '--model` argument by using its integer depth multiplier (50, 75, 100, 101). The default is the 101 model.\n\n#### image_demo.py \n\nImage demo runs inference on an input folder of images and outputs those images with the keypoints and skeleton overlayed.\n\n`python image_demo.py --model 101 --image_dir ./images --output_dir ./output`\n\nA folder of suitable test images can be downloaded by first running the `get_test_images.py` script.\n\n#### benchmark.py\n\nA minimal performance benchmark based on image_demo. Images in `--image_dir` are pre-loaded and inference is run `--num_images` times with no drawing and no text output.\n\n#### webcam_demo.py\n\nThe webcam demo uses OpenCV to capture images from a connected webcam. The result is overlayed with the keypoints and skeletons and rendered to the screen. The default args for the webcam_demo assume device_id=0 for the camera and that 1280x720 resolution is possible.\n\n### Credits\n\nThe original model, weights, code, etc. was created by Google and can be found at https://github.com/tensorflow/tfjs-models/tree/master/posenet\n\nThis port and my work is in no way related to Google.\n\nThe Python conversion code that started me on my way was adapted from the CoreML port at https://github.com/infocom-tpo/PoseNet-CoreML\n\n### TODO (someday, maybe)\n* More stringent verification of correctness against the original implementation\n* Performance improvements (especially edge loops in 'decode.py')\n* OpenGL rendering/drawing\n* Comment interfaces, tensor dimensions, etc\n* Implement batch inference for image_demo\n* Create a training routine and add models with more advanced CNN backbones\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwightman%2Fposenet-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwightman%2Fposenet-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwightman%2Fposenet-pytorch/lists"}