{"id":13442956,"url":"https://github.com/vietanhdev/tf-blazepose","last_synced_at":"2025-03-20T15:31:40.744Z","repository":{"id":41293167,"uuid":"315851656","full_name":"vietanhdev/tf-blazepose","owner":"vietanhdev","description":"BlazePose - Super fast human pose detection on Tensorflow 2.x","archived":true,"fork":false,"pushed_at":"2021-10-29T15:55:42.000Z","size":4097,"stargazers_count":192,"open_issues_count":20,"forks_count":38,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-01T03:42:28.063Z","etag":null,"topics":["blazepose","landmark-detection","posenet","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vietanhdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-25T06:42:25.000Z","updated_at":"2024-05-27T11:41:26.000Z","dependencies_parsed_at":"2022-07-07T11:23:35.212Z","dependency_job_id":null,"html_url":"https://github.com/vietanhdev/tf-blazepose","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/vietanhdev%2Ftf-blazepose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhdev%2Ftf-blazepose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhdev%2Ftf-blazepose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhdev%2Ftf-blazepose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vietanhdev","download_url":"https://codeload.github.com/vietanhdev/tf-blazepose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221772625,"owners_count":16878143,"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":["blazepose","landmark-detection","posenet","tensorflow2"],"created_at":"2024-07-31T03:01:53.828Z","updated_at":"2024-10-28T03:31:27.281Z","avatar_url":"https://github.com/vietanhdev.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# BlazePose Tensorflow 2.x\n\nThis is an implementation of Google BlazePose in Tensorflow 2.x. The original paper is \"BlazePose: On-device Real-time Body Pose tracking\" by Valentin Bazarevsky, Ivan Grishchenko, Karthik Raveendran, Tyler Zhu, Fan Zhang, and Matthias Grundmann, which is available on [arXiv](https://arxiv.org/abs/2006.10204). You can find some demonstrations of BlazePose from [Google blog](https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html).\n\nCurrently, the model being developed in this repo is based on TFLite (.tflite) model from [here](https://github.com/PINTO0309/PINTO_model_zoo/tree/master/058_BlazePose_Full_Keypoints/01_Accurate). I use [Netron.app](https://netron.app/) to visualize the architecture and try to mimic that architecture in my implementation. The visualized model architecture can be found [here](images/blazepose_full.png). Other architectures will be added in the future.\n\n**Note:** This repository is still under active development.\n\n**Update 14/12/2020:** Our PushUp Counter App is using this BlazePose model to count pushups from videos/webcam. [***Read more.***](https://github.com/vietanhdev/pushup-counter-app)\n\n## TODOs\n\n- [ ] Implementation\n\n    - [x] Initialize code for model from .tflite file.\n\n    - [x] Basic dataset loader\n\n    - [x] Implement loss function.\n\n    - [x] Implement training code.\n\n    - [x] Advanced augmentation: Random occlusion (BlazePose paper)\n\n    - [x] Implement demo code for video and webcam.\n\n    - [x] Support PCK metric.\n\n    - [ ] Implement testing code.\n\n    - [ ] Add training graph and pretrained models.\n\n    - [ ] Support offset maps.\n\n    - [ ] Experiment with other loss functions.\n\n    - [ ] Workout counting from keypoints.\n\n    - [ ] Rewrite in eager mode.\n\n- [ ] Datasets\n\n    - [x] Support LSP dataset and LSPET dataset (partially). [More](DATASET.md).\n\n    - [x] Support PushUps dataset.\n\n    - [x] Support MPII dataset.\n\n    - [ ] Support YOGA-82 dataset.\n\n    - [ ] Custom dataset.\n\n- [ ] Convert and run model in TF Lite format.\n\n- [ ] Convert and run model in TensorRT.\n\n- [ ] Convert and run model in Tensorflow.js.\n\n## Demo\n\n- Download pretrained model for PushUp dataset [here](https://1drv.ms/u/s!Av71xxzl6mYZgddJ7IdF0wfjwI3sgw?e=l94WL5) and put into `trained_models/blazepose_pushup_v1.h5`. Test with your webcam:\n\n```\npython run_video.py -c configs/mpii/config_blazepose_mpii_pushup_heatmap_bce_regress_huber.json  -m trained_models/blazepose_pushup_v1.h5 -v webcam --confidence 0.3\n```\n\nThe pretrained model is only in experimental state now. It only detects 7 keypoints for Push Up counting and it may not produce a good result now. I will update other models in the future.\n\n## Training\n\n**NOTE:** Currently, I only focus on PushUp datase, which contains 7 keypoints. Due to the copyright of this dataset, I don't have permission to publish it on the Internet. You can read the instruction and try with your own dataset.\n\n- Prepare dataset using instruction from [DATASET.md](DATASET.md).\n\n- Training heatmap branch:\n\n```\npython train.py -c configs/mpii/config_blazepose_mpii_pushup_heatmap_bce.json\n```\n\n- After heatmap branch converged, set `load_weights` to `true` and update the `pretrained_weights_path` to the best model, and continue with the regression branch:\n\n```\npython train.py -c configs/mpii/config_blazepose_mpii_pushup_heatmap_bce_regress_huber.json\n```\n\n## Reference\n\n- Cite the original paper:\n\n```tex\n@article{Bazarevsky2020BlazePoseOR,\n  title={BlazePose: On-device Real-time Body Pose tracking},\n  author={Valentin Bazarevsky and I. Grishchenko and K. Raveendran and Tyler Lixuan Zhu and Fangfang Zhang and M. Grundmann},\n  journal={ArXiv},\n  year={2020},\n  volume={abs/2006.10204}\n}\n```\n\nThis source code uses some code and ideas from these repos:\n\n- https://fairyonice.github.io/Achieving-top-5-in-Kaggles-facial-keypoints-detection-using-FCN.html\n- https://github.com/yuanyuanli85/Stacked_Hourglass_Network_Keras\n\n## Contributions\n\nPlease feel free to [submit an issue](https://github.com/vietanhdev/tf-blazepose/issues) or [pull a request](https://github.com/vietanhdev/tf-blazepose/pulls).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvietanhdev%2Ftf-blazepose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvietanhdev%2Ftf-blazepose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvietanhdev%2Ftf-blazepose/lists"}