{"id":13610419,"url":"https://github.com/ipazc/mtcnn","last_synced_at":"2025-05-14T00:10:51.014Z","repository":{"id":37396681,"uuid":"116340040","full_name":"ipazc/mtcnn","owner":"ipazc","description":"MTCNN face detection implementation for TensorFlow, as a PIP package.","archived":false,"fork":false,"pushed_at":"2024-10-08T16:09:34.000Z","size":9481,"stargazers_count":2265,"open_issues_count":26,"forks_count":529,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-12-30T14:09:04.553Z","etag":null,"topics":["detection","face","landmark","mtcnn","package","pip","python3","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/ipazc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ipazc"}},"created_at":"2018-01-05T04:08:32.000Z","updated_at":"2024-12-30T08:11:37.000Z","dependencies_parsed_at":"2024-06-18T12:25:38.503Z","dependency_job_id":"7043dad1-c8ae-4ad3-a4e4-8c1490919423","html_url":"https://github.com/ipazc/mtcnn","commit_stats":{"total_commits":42,"total_committers":17,"mean_commits":"2.4705882352941178","dds":0.6904761904761905,"last_synced_commit":"3208d443a8f01d317c65d7c97a03bc0a6143c41d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipazc%2Fmtcnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipazc%2Fmtcnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipazc%2Fmtcnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipazc%2Fmtcnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipazc","download_url":"https://codeload.github.com/ipazc/mtcnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254044364,"owners_count":22005145,"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":["detection","face","landmark","mtcnn","package","pip","python3","tensorflow"],"created_at":"2024-08-01T19:01:44.522Z","updated_at":"2025-05-14T00:10:46.005Z","avatar_url":"https://github.com/ipazc.png","language":"Jupyter Notebook","readme":"# MTCNN - Multitask Cascaded Convolutional Networks for Face Detection and Alignment\n\n[![PyPI version](https://badge.fury.io/py/mtcnn.svg)](https://badge.fury.io/py/mtcnn)\n[![Documentation Status](https://readthedocs.org/projects/mtcnn/badge/?version=latest)](https://mtcnn.readthedocs.io/en/latest/?badge=latest)\n![Test Status](https://github.com/ipazc/mtcnn/actions/workflows/tests.yml/badge.svg)\n![Pylint Check](https://github.com/ipazc/mtcnn/actions/workflows/pylint.yml/badge.svg)\n![PyPI Downloads](https://img.shields.io/pypi/dm/mtcnn)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13901378.svg)](https://doi.org/10.5281/zenodo.13901378)\n\n\n\n## Overview\n\n![Example](resources/result.jpg)\n\nMTCNN is a robust face detection and alignment library implemented for Python \u003e= 3.10 and TensorFlow \u003e= 2.12, designed to detect faces and their landmarks using a multitask cascaded convolutional network. This library improves on the original implementation by offering a complete refactor, simplifying usage, improving performance, and providing support for batch processing.\n\nThis library is ideal for applications requiring face detection and alignment, with support for both bounding box and landmark prediction.\n\n## Installation\n\nMTCNN can be installed via pip:\n\n```bash\npip install mtcnn\n```\n\nMTCNN requires Tensorflow \u003e= 2.12. This external dependency can be installed manually or automatically along with MTCNN via:\n\n```bash\npip install mtcnn[tensorflow]\n```\n\n## Usage Example\n\n```python\nfrom mtcnn import MTCNN\nfrom mtcnn.utils.images import load_image\n\n# Create a detector instance\ndetector = MTCNN(device=\"CPU:0\")\n\n# Load an image\nimage = load_image(\"ivan.jpg\")\n\n# Detect faces in the image\nresult = detector.detect_faces(image)\n\n# Display the result\nprint(result)\n```\n\nOutput example:\n\n```json\n[\n    {\n        \"box\": [277, 90, 48, 63],\n        \"keypoints\": {\n            \"nose\": [303, 131],\n            \"mouth_right\": [313, 141],\n            \"right_eye\": [314, 114],\n            \"left_eye\": [291, 117],\n            \"mouth_left\": [296, 143]\n        },\n        \"confidence\": 0.9985\n    }\n]\n```\n\n## Models Overview\n\nMTCNN uses a cascade of three networks to detect faces and facial landmarks:\n\n- **PNet (Proposal Network)**: Scans the image and proposes candidate face regions. \n- **RNet (Refine Network)**: Refines the face proposals from PNet.\n- **ONet (Output Network)**: Detects facial landmarks (eyes, nose, mouth) and provides a final refinement of the bounding boxes.\n\nAll networks are implemented using TensorFlow’s functional API and optimized to avoid unnecessary operations, such as transpositions, ensuring faster and more efficient execution.\n\n# Documentation\n\nThe full documentation for this project is available at [Read the Docs](http://mtcnn.readthedocs.io/).\n\n\n## Citation\n\nIf you use this library implementation for your research or projects, please consider using this cite:\n\n```\n@software{ivan_de_paz_centeno_2024_13901378,\n  author       = {Iván de Paz Centeno},\n  title        = {ipazc/mtcnn: v1.0.0},\n  month        = oct,\n  year         = 2024,\n  publisher    = {Zenodo},\n  version      = {v1.0.0},\n  doi          = {10.5281/zenodo.13901378},\n  url          = {https://doi.org/10.5281/zenodo.13901378}\n}\n```\n\nAnd the original research work from Kaipeng Zhang:\n\n```\n@article{7553523,\n    author={K. Zhang and Z. Zhang and Z. Li and Y. Qiao}, \n    journal={IEEE Signal Processing Letters}, \n    title={Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks}, \n    year={2016}, \n    volume={23}, \n    number={10}, \n    pages={1499-1503}, \n    keywords={Benchmark testing;Computer architecture;Convolution;Detectors;Face;Face detection;Training;Cascaded convolutional neural network (CNN);face alignment;face detection}, \n    doi={10.1109/LSP.2016.2603342}, \n    ISSN={1070-9908}, \n    month={Oct}\n}\n```\n\nYou may also reference the original GitHub repository that this project was based on (including the networks weights):  \n[Original MTCNN Implementation by Kaipeng Zhang](https://github.com/kpzhang93/MTCNN_face_detection_alignment/tree/master/code)\n\nAnd the FaceNet's implementation that served as inspiration:\n[Facenet's MTCNN implementation](https://github.com/davidsandberg/facenet/tree/master/src/align)\n\n\n## About the Author\n\nThis project is developed and maintained by [Iván de Paz Centeno](https://ipazc.com), with the goal of standardizing face detection and providing an easy-to-use framework to help the research community push the boundaries of AI knowledge.\n\nIf you find this project useful, please consider supporting it through GitHub Sponsors. Your support will help cover costs related to improving the codebase, adding new features, and providing better documentation.\n\n[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-brightgreen)](https://github.com/sponsors/ipazc)\n\n\n## Acknowledgments\n\nThis project has evolved over time with contributions from multiple developers. While the current codebase has been completely rewritten, we acknowledge and appreciate the valuable input and collaboration from past contributors.\n\nA special thanks to everyone who has submitted pull requests, reported issues, or provided feedback to make this project better. \n\nFor a full list of contributors, please visit the [GitHub contributors page](https://github.com/ipazc/mtcnn/graphs/contributors).\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","funding_links":["https://github.com/sponsors/ipazc"],"categories":["图像数据与CV","Jupyter Notebook","Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipazc%2Fmtcnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipazc%2Fmtcnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipazc%2Fmtcnn/lists"}