{"id":13653294,"url":"https://github.com/HRNet/HRNet-Facial-Landmark-Detection","last_synced_at":"2025-04-23T06:31:31.667Z","repository":{"id":34580228,"uuid":"180372680","full_name":"HRNet/HRNet-Facial-Landmark-Detection","owner":"HRNet","description":"This is an official implementation of facial landmark detection for our TPAMI paper \"Deep High-Resolution Representation Learning for Visual Recognition\". https://arxiv.org/abs/1908.07919","archived":false,"fork":false,"pushed_at":"2022-08-12T08:03:02.000Z","size":3697,"stargazers_count":1079,"open_issues_count":66,"forks_count":264,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-12T08:38:34.836Z","etag":null,"topics":["deep-high-resolution-net","face-alignment","facealignment","facial-landmarks","hrnets"],"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/HRNet.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":"2019-04-09T13:25:44.000Z","updated_at":"2025-03-31T07:27:32.000Z","dependencies_parsed_at":"2022-07-14T10:21:32.238Z","dependency_job_id":null,"html_url":"https://github.com/HRNet/HRNet-Facial-Landmark-Detection","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/HRNet%2FHRNet-Facial-Landmark-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-Facial-Landmark-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-Facial-Landmark-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-Facial-Landmark-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HRNet","download_url":"https://codeload.github.com/HRNet/HRNet-Facial-Landmark-Detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250384983,"owners_count":21421828,"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-high-resolution-net","face-alignment","facealignment","facial-landmarks","hrnets"],"created_at":"2024-08-02T02:01:08.355Z","updated_at":"2025-04-23T06:31:26.645Z","avatar_url":"https://github.com/HRNet.png","language":"Python","funding_links":[],"categories":["Python","Face Perception"],"sub_categories":["Facial Landmark"],"readme":"# High-resolution networks (HRNets) for facial landmark detection\n\n## News\n- [2020/03/13] Our paper is accepted by TPAMI: [Deep High-Resolution Representation Learning for Visual Recognition](https://arxiv.org/pdf/1908.07919.pdf).\n\n## Introduction \nThis is the official code of [High-Resolution Representations for Facial Landmark Detection](https://arxiv.org/pdf/1904.04514.pdf). \nWe extend the high-resolution representation (HRNet) [1] by augmenting the high-resolution representation by aggregating the (upsampled) \nrepresentations from all the parallel convolutions, leading to stronger representations. The output representations are fed into\nclassifier. We evaluate our methods on four datasets, COFW, AFLW, WFLW and 300W.\n\n\u003cdiv align=center\u003e\n\n![](images/hrnet.jpg)\n\n\u003c/div\u003e\n\n## Performance\n### ImageNet pretrained models\nHRNetV2 ImageNet pretrained models are now available! Codes and pretrained models are in [HRNets for Image Classification](https://github.com/HRNet/HRNet-Image-Classification)\n\n\nWe adopt **HRNetV2-W18**(#Params=9.3M, GFLOPs=4.3G) for facial landmark detection on COFW, AFLW, WFLW and 300W.\n\n### COFW\n\nThe model is trained on COFW *train* and evaluated on COFW *test*.\n\n| Model | NME | FR\u003csub\u003e0.1\u003c/sub\u003e|pretrained model|model|\n|:--:|:--:|:--:|:--:|:--:|\n|HRNetV2-W18  | 3.45 | 0.20 | [HRNetV2-W18](https://1drv.ms/u/s!Aus8VCZ_C_33cMkPimlmClRvmpw) | [HR18-COFW.pth](https://1drv.ms/u/s!AiWjZ1LamlxzdFIsEUQl8jgUaMk)|\n\n\n### AFLW\nThe model is trained on AFLW *train* and evaluated on AFLW *full* and *frontal*.\n\n| Model | NME\u003csub\u003e*full*\u003c/sub\u003e | NME\u003csub\u003e*frontal*\u003c/sub\u003e | pretrained model|model|\n|:--:|:--:|:--:|:--:|:--:|\n|HRNetV2-W18 | 1.57 | 1.46 | [HRNetV2-W18](https://1drv.ms/u/s!Aus8VCZ_C_33cMkPimlmClRvmpw) | [HR18-AFLW.pth](https://1drv.ms/u/s!AiWjZ1Lamlxzc7xumEw810iBLTc)|\n\n### WFLW\n\n| NME |  *test* | *pose* | *illumination* | *occlution* | *blur* | *makeup* | *expression* | pretrained model|model|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|HRNetV2-W18 | 4.60 | 7.86 | 4.57 | 5.42 | 5.36 | 4.26 | 4.78 | [HRNetV2-W18](https://1drv.ms/u/s!Aus8VCZ_C_33cMkPimlmClRvmpw) | [HR18-WFLW.pth](https://1drv.ms/u/s!AiWjZ1LamlxzdTsr_9QZCwJsn5U)|\n\n\n### 300W\n\n| NME | *common*| *challenge* | *full* | *test*|  pretrained model|model|\n|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n|HRNetV2-W18 | 2.91 | 5.11 | 3.34 | 3.85 | [HRNetV2-W18](https://1drv.ms/u/s!Aus8VCZ_C_33cMkPimlmClRvmpw) | [HR18-300W.pth](https://1drv.ms/u/s!AiWjZ1LamlxzeYLmza1XU-4WhnQ)|\n\n\n![](images/face.png)\n\n## Quick start\n#### Environment\nThis code is developed using on Python 3.6 and PyTorch 1.0.0 on Ubuntu 16.04 with NVIDIA GPUs. Training and testing are \nperformed using 1 NVIDIA P40 GPU with CUDA 9.0 and cuDNN 7.0. Other platforms or GPUs are not fully tested.\n\n#### Install\n1. Install PyTorch 1.0 following the [official instructions](https://pytorch.org/)\n2. Install dependencies\n````bash\n\npip install -r requirements.txt\n````\n3. Clone the project\n````bash \ngit clone https://github.com/HRNet/HRNet-Facial-Landmark-Detection.git\n````\n\n#### HRNetV2 pretrained models\n```bash\ncd HRNet-Facial-Landmark-Detection\n# Download pretrained models into this folder\nmkdir hrnetv2_pretrained\n```\n#### Data\n\n1. You need to download the annotations files which have been processed from [OneDrive](https://1drv.ms/u/s!AiWjZ1LamlxzdmYbSkHpPYhI8Ms), [Cloudstor](https://cloudstor.aarnet.edu.au/plus/s/m9lHU2aJId8Sh8l), and [BaiduYun(Acess Code:ypxg)](https://pan.baidu.com/s/1Yg1IEp3l2IpGPolpUsWdfg).\n\n2. You need to download images (300W, AFLW, WFLW) from official websites and then put them into `images` folder for each dataset.\n\nYour `data` directory should look like this:\n\n````\nHRNet-Facial-Landmark-Detection\n-- lib\n-- experiments\n-- tools\n-- data\n   |-- 300w\n   |   |-- face_landmarks_300w_test.csv\n   |   |-- face_landmarks_300w_train.csv\n   |   |-- face_landmarks_300w_valid.csv\n   |   |-- face_landmarks_300w_valid_challenge.csv\n   |   |-- face_landmarks_300w_valid_common.csv\n   |   |-- images\n   |-- aflw\n   |   |-- face_landmarks_aflw_test.csv\n   |   |-- face_landmarks_aflw_test_frontal.csv\n   |   |-- face_landmarks_aflw_train.csv\n   |   |-- images\n   |-- cofw\n   |   |-- COFW_test_color.mat\n   |   |-- COFW_train_color.mat  \n   |-- wflw\n   |   |-- face_landmarks_wflw_test.csv\n   |   |-- face_landmarks_wflw_test_blur.csv\n   |   |-- face_landmarks_wflw_test_expression.csv\n   |   |-- face_landmarks_wflw_test_illumination.csv\n   |   |-- face_landmarks_wflw_test_largepose.csv\n   |   |-- face_landmarks_wflw_test_makeup.csv\n   |   |-- face_landmarks_wflw_test_occlusion.csv\n   |   |-- face_landmarks_wflw_train.csv\n   |   |-- images\n\n````\n\n#### Train\nPlease specify the configuration file in `experiments` (learning rate should be adjusted when the number of GPUs is changed).\n````bash\npython tools/train.py --cfg \u003cCONFIG-FILE\u003e\n# example:\npython tools/train.py --cfg experiments/wflw/face_alignment_wflw_hrnet_w18.yaml\n````\n\n#### Test\n````bash\npython tools/test.py --cfg \u003cCONFIG-FILE\u003e --model-file \u003cMODEL WEIGHT\u003e \n# example:\npython tools/test.py --cfg experiments/wflw/face_alignment_wflw_hrnet_w18.yaml --model-file HR18-WFLW.pth\n````\n\n \n## Other applications of HRNets (codes and models):\n* [Human pose estimation](https://github.com/leoxiaobin/deep-high-resolution-net.pytorch)\n* [Semantic segmentation](https://github.com/HRNet/HRNet-Semantic-Segmentation)\n* [Object detection](https://github.com/HRNet/HRNet-Object-Detection)\n* [Image classification](https://github.com/HRNet/HRNet-Image-Classification)\n \n## Citation\nIf you find this work or code is helpful in your research, please cite:\n````\n@inproceedings{SunXLW19,\n  title={Deep High-Resolution Representation Learning for Human Pose Estimation},\n  author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},\n  booktitle={CVPR},\n  year={2019}\n}\n\n@article{WangSCJDZLMTWLX19,\n  title={Deep High-Resolution Representation Learning for Visual Recognition},\n  author={Jingdong Wang and Ke Sun and Tianheng Cheng and \n          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and \n          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},\n  journal   = {TPAMI}\n  year={2019}\n}\n````\n\n## Reference\n[1] Deep High-Resolution Representation Learning for Visual Recognition. Jingdong Wang, Ke Sun, Tianheng Cheng, \n    Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, Bin Xiao. Accepted by TPAMI.  [download](https://arxiv.org/pdf/1908.07919.pdf)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHRNet%2FHRNet-Facial-Landmark-Detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHRNet%2FHRNet-Facial-Landmark-Detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHRNet%2FHRNet-Facial-Landmark-Detection/lists"}