{"id":13493278,"url":"https://github.com/yinguobing/head-pose-estimation","last_synced_at":"2025-10-18T22:24:35.821Z","repository":{"id":40680463,"uuid":"115493935","full_name":"yinguobing/head-pose-estimation","owner":"yinguobing","description":"Realtime human head pose estimation with ONNXRuntime and OpenCV.","archived":false,"fork":false,"pushed_at":"2024-09-02T09:14:02.000Z","size":3874,"stargazers_count":1274,"open_issues_count":31,"forks_count":291,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-13T10:58:39.061Z","etag":null,"topics":["convolutional-neural-networks","deep-learning","facial-landmarks-detection","onnxruntime","opencv","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yinguobing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://yinguobing.com/thanks/"]}},"created_at":"2017-12-27T07:23:35.000Z","updated_at":"2025-04-11T17:18:25.000Z","dependencies_parsed_at":"2024-04-12T00:41:17.867Z","dependency_job_id":"4e899eec-d2a9-4bff-a238-186822cbd237","html_url":"https://github.com/yinguobing/head-pose-estimation","commit_stats":{"total_commits":147,"total_committers":2,"mean_commits":73.5,"dds":0.006802721088435382,"last_synced_commit":"e0c37703e31807e49ab46d919cd010a7809b2300"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinguobing%2Fhead-pose-estimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinguobing%2Fhead-pose-estimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinguobing%2Fhead-pose-estimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinguobing%2Fhead-pose-estimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinguobing","download_url":"https://codeload.github.com/yinguobing/head-pose-estimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436932,"owners_count":22070944,"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":["convolutional-neural-networks","deep-learning","facial-landmarks-detection","onnxruntime","opencv","tensorflow"],"created_at":"2024-07-31T19:01:13.800Z","updated_at":"2025-10-18T22:24:30.785Z","avatar_url":"https://github.com/yinguobing.png","language":"Python","funding_links":["https://yinguobing.com/thanks/"],"categories":["Deep Learning"],"sub_categories":["Problems"],"readme":"# Head pose estimation\n\nRealtime human head pose estimation with ONNX Runtime and OpenCV.\n\n![demo](doc/demo.gif)\n![demo](doc/demo1.gif)\n\n## How it works\n\nThere are three major steps:\n\n1. Face detection. A face detector is introduced to provide a face bounding box containing a human face. Then the face box is expanded and transformed to a square to suit the needs of later steps.\n2. Facial landmark detection. A pre-trained deep learning model take the face image as input and output 68 facial landmarks.\n3. Pose estimation. After getting 68 facial landmarks, the pose could be calculated by a mutual PnP algorithm.\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\nThe code was tested on Ubuntu 22.04 with following frameworks:\n- ONNX Runtime: 1.17.1\n- OpenCV: 4.5.4\n\n### Installing\n\nClone the repo:\n```bash\ngit clone https://github.com/yinguobing/head-pose-estimation.git\n```\n\nInstall dependencies with pip:\n```bash\npip install -r requirements.txt\n```\n\nPre-trained models provided in the `assets` directory. Download them with Git LFS:\n```bash\ngit lfs pull\n```\n\nOr, download manually from the [release page](https://github.com/yinguobing/head-pose-estimation/releases).\n\n## Running\n\nA video file or a webcam index should be assigned through arguments. If no source provided, the built in webcam will be used by default.\n\n### Video file\n\nFor any video format that OpenCV supports (`mp4`, `avi` etc.):\n\n```bash\npython3 main.py --video /path/to/video.mp4\n```\n\n### Webcam\n\nThe webcam index should be provided:\n\n```bash\npython3 main.py --cam 0\n``` \n\n## Retrain the model\n\nTutorials: https://yinguobing.com/deeplearning/\n\nTraining code: https://github.com/yinguobing/cnn-facial-landmark\n\nNote: PyTorch version coming soon!\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \n\nMeanwhile: \n\n- The face detector is [SCRFD](https://github.com/deepinsight/insightface/tree/master/detection/scrfd) from InsightFace. \n- The pre-trained model file was trained with various public datasets which have their own licenses. \n\nPlease refer to them for details.\n\n## Authors\nYin Guobing (尹国冰) - [yinguobing](https://yinguobing.com)\n\n![](doc/wechat_logo.png)\n\n## Acknowledgments\n\nAll datasets used in the training process:\n- 300-W: https://ibug.doc.ic.ac.uk/resources/300-W/\n- 300-VW: https://ibug.doc.ic.ac.uk/resources/300-VW/\n- LFPW: https://neerajkumar.org/databases/lfpw/\n- HELEN: http://www.ifp.illinois.edu/~vuongle2/helen/\n- AFW: https://www.ics.uci.edu/~xzhu/face/\n- IBUG: https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/\n\nThe 3D face model is from OpenFace, you can find the original file [here](https://github.com/TadasBaltrusaitis/OpenFace/blob/master/lib/local/LandmarkDetector/model/pdms/In-the-wild_aligned_PDM_68.txt).\n\nThe build in face detector is [SCRFD](https://github.com/deepinsight/insightface/tree/master/detection/scrfd) from InsightFace. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinguobing%2Fhead-pose-estimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinguobing%2Fhead-pose-estimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinguobing%2Fhead-pose-estimation/lists"}