{"id":16866017,"url":"https://github.com/elliottzheng/face-detection","last_synced_at":"2025-07-18T20:35:49.779Z","repository":{"id":44147923,"uuid":"233762891","full_name":"elliottzheng/face-detection","owner":"elliottzheng","description":"Fast and reliable face detection with RetinaFace.PyTorch","archived":false,"fork":false,"pushed_at":"2023-12-16T13:08:34.000Z","size":1805,"stargazers_count":114,"open_issues_count":3,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-16T08:51:08.870Z","etag":null,"topics":["face-detection","python","pytorch","retinaface"],"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/elliottzheng.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-14T05:23:02.000Z","updated_at":"2025-03-12T05:25:54.000Z","dependencies_parsed_at":"2024-10-27T12:10:30.500Z","dependency_job_id":"71afc445-095f-4054-947b-4267b465b4ca","html_url":"https://github.com/elliottzheng/face-detection","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliottzheng%2Fface-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliottzheng%2Fface-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliottzheng%2Fface-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliottzheng%2Fface-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliottzheng","download_url":"https://codeload.github.com/elliottzheng/face-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243981547,"owners_count":20378590,"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":["face-detection","python","pytorch","retinaface"],"created_at":"2024-10-13T14:49:11.500Z","updated_at":"2025-03-17T05:32:44.251Z","avatar_url":"https://github.com/elliottzheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🚧This repo is no longer maintained, it can be seamlessly replaced with the new repo [batch-face](https://github.com/elliottzheng/batch-face) with the exact same usage.🚧 \n**The [batch-face](https://github.com/elliottzheng/batch-face) provides more utility for face detection, face alignment and face reconstruction.**\n\n# Face Detection\n\nFast and reliable face detection with [RetinaFace](https://arxiv.org/abs/1905.00641).\n\nThis repo provides the out-of-box RetinaFace detector.\n\n### Requirements\n\n- Python 3.5+ (it may work with other versions too)\n- Linux, Windows or macOS\n- PyTorch (\u003e=1.0)\n\nWhile not required, for optimal performance it is highly recommended to run the code using a CUDA enabled GPU.\n\n## Install\n\nThe easiest way to install it is using pip:\n\n```bash\npip install git+https://github.com/elliottzheng/face-detection.git@master\n```\n\n## Usage\n##### Detect face and five landmarks on single image\n```python\nfrom skimage import io\nfrom face_detection import RetinaFace\n\ndetector = RetinaFace()\nimg= io.imread('examples/obama.jpg')\nfaces = detector(img)\nbox, landmarks, score = faces[0]\n```\n##### Running on CPU/GPU\n\nIn order to specify the device (GPU or CPU) on which the code will run one can explicitly pass the device id.\n```python\nfrom face_detection import RetinaFace\n# 0 means using GPU with id 0 for inference\n# default -1: means using cpu for inference\ndetector = RetinaFace(gpu_id=0) \n```\n|      | GPU(GTX 1080TI,batch size=1) | GPU(GTX 1080TI，batch size=750) | CPU(Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz) |\n| ---- | ---------------------------- | ------------------------------- | --------------------------------------------- |\n| FPS  | 44.02405810720893            | 96.64058005582535               | 15.452635835550483                            |\n| SPF  | 0.022714852809906007         | 0.010347620010375976            | 0.0647138786315918                            |\n\n\n##### Batch input for faster detection\n\nAll the input images must of the same size.\n\n**Detector with CUDA process batch input faster than the same amount of single input.** \n\n```python\nfrom skimage import io\nfrom face_detection import RetinaFace\n\ndetector = RetinaFace()\nimg= io.imread('examples/obama.jpg')\nall_faces = detector([img,img]) # return faces list of all images\nbox, landmarks, score = all_faces[0][0]\n```\n\n![](./images/gpu_batch.png)\n\n## Reference\n\n- Network and pretrained model are from [biubug6/Pytorch_Retinaface](https://github.com/biubug6/Pytorch_Retinaface)\n\n```\n@inproceedings{deng2019retinaface,\ntitle={RetinaFace: Single-stage Dense Face Localisation in the Wild},\nauthor={Deng, Jiankang and Guo, Jia and Yuxiang, Zhou and Jinke Yu and Irene Kotsia and Zafeiriou, Stefanos},\nbooktitle={arxiv},\nyear={2019}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliottzheng%2Fface-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliottzheng%2Fface-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliottzheng%2Fface-detection/lists"}