Name | mtcnn JSON |
Version |
1.0.0
JSON |
| download |
home_page | https://github.com/ipazc/mtcnn |
Summary | Multitask Cascaded Convolutional Networks for face detection and alignment (MTCNN) in Python >= 3.10 and TensorFlow >= 2.12 |
upload_time | 2024-10-08 01:42:22 |
maintainer | None |
docs_url | None |
author | Iván de Paz Centeno |
requires_python | >=3.10 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
joblib
lz4
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# MTCNN - Multitask Cascaded Convolutional Networks for Face Detection and Alignment
[![PyPI version](https://badge.fury.io/py/mtcnn.svg)](https://badge.fury.io/py/mtcnn)
[![Documentation Status](https://readthedocs.org/projects/mtcnn/badge/?version=latest)](https://mtcnn.readthedocs.io/en/latest/?badge=latest)
![Test Status](https://github.com/ipazc/mtcnn/actions/workflows/tests.yml/badge.svg)
![Pylint Check](https://github.com/ipazc/mtcnn/actions/workflows/pylint.yml/badge.svg)
![PyPI Downloads](https://img.shields.io/pypi/dm/mtcnn)
## Overview
![Example](resources/result.jpg)
MTCNN is a robust face detection and alignment library implemented for Python >= 3.10 and TensorFlow >= 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.
This library is ideal for applications requiring face detection and alignment, with support for both bounding box and landmark prediction.
## Installation
MTCNN can be installed via pip:
```bash
pip install mtcnn
```
MTCNN requires Tensorflow >= 2.12. This external dependency can be installed manually or automatically along with MTCNN via:
```bash
pip install mtcnn[tensorflow]
```
## Usage Example
```python
from mtcnn import MTCNN
from mtcnn.utils.images import load_image
# Create a detector instance
detector = MTCNN(device="CPU:0")
# Load an image
image = load_image("ivan.jpg")
# Detect faces in the image
result = detector.detect_faces(image)
# Display the result
print(result)
```
Output example:
```json
[
{
"box": [277, 90, 48, 63],
"keypoints": {
"nose": (303, 131),
"mouth_right": (313, 141),
"right_eye": (314, 114),
"left_eye": (291, 117),
"mouth_left": (296, 143)
},
"confidence": 0.9985
}
]
```
## Models Overview
MTCNN uses a cascade of three networks to detect faces and facial landmarks:
- **PNet (Proposal Network)**: Scans the image and proposes candidate face regions.
- **RNet (Refine Network)**: Refines the face proposals from PNet.
- **ONet (Output Network)**: Detects facial landmarks (eyes, nose, mouth) and provides a final refinement of the bounding boxes.
All networks are implemented using TensorFlow’s functional API and optimized to avoid unnecessary operations, such as transpositions, ensuring faster and more efficient execution.
# Documentation
The full documentation for this project is available at [Read the Docs](http://mtcnn.readthedocs.io/).
## Citation
If you use this library for your research or projects, please consider citing the original work:
```
@article{7553523,
author={K. Zhang and Z. Zhang and Z. Li and Y. Qiao},
journal={IEEE Signal Processing Letters},
title={Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks},
year={2016},
volume={23},
number={10},
pages={1499-1503},
keywords={Benchmark testing;Computer architecture;Convolution;Detectors;Face;Face detection;Training;Cascaded convolutional neural network (CNN);face alignment;face detection},
doi={10.1109/LSP.2016.2603342},
ISSN={1070-9908},
month={Oct}
}
```
You may also reference the original GitHub repository that this project was based on (including the networks weights):
[Original MTCNN Implementation by Kaipeng Zhang](https://github.com/kpzhang93/MTCNN_face_detection_alignment/tree/master/code)
And the FaceNet's implementation that served as inspiration:
[Facenet's MTCNN implementation](https://github.com/davidsandberg/facenet/tree/master/src/align)
## About this project
The code for this project was created to standardize face detection and provide an easy-to-use framework that helps the research community push the boundaries of AI knowledge. Learn more about the author of this code on [Iván de Paz Centeno's website](https://ipazc.com)
If you find this project useful, please consider supporting it through GitHub Sponsors.
[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-brightgreen)](https://github.com/sponsors/ipazc)
Your support will help cover costs related to improving the codebase, adding new features, and providing better documentation.
## License
This project is licensed under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/ipazc/mtcnn",
"name": "mtcnn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Iv\u00e1n de Paz Centeno",
"author_email": "ipazc@unileon.es",
"download_url": "https://files.pythonhosted.org/packages/67/37/b0f60411b6a37dcd5122bbe05c9aa45f271bcc8129caa45ee1012251905d/mtcnn-1.0.0.tar.gz",
"platform": null,
"description": "# 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\n\n## Overview\n\n![Example](resources/result.jpg)\n\nMTCNN is a robust face detection and alignment library implemented for Python >= 3.10 and TensorFlow >= 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 >= 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\u2019s 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 for your research or projects, please consider citing the original work:\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## About this project\n\nThe code for this project was created to standardize face detection and provide an easy-to-use framework that helps the research community push the boundaries of AI knowledge. Learn more about the author of this code on [Iv\u00e1n de Paz Centeno's website](https://ipazc.com)\n\nIf you find this project useful, please consider supporting it through GitHub Sponsors.\n\n[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-brightgreen)](https://github.com/sponsors/ipazc)\n\nYour support will help cover costs related to improving the codebase, adding new features, and providing better documentation.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Multitask Cascaded Convolutional Networks for face detection and alignment (MTCNN) in Python >= 3.10 and TensorFlow >= 2.12",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://github.com/ipazc/mtcnn/docs",
"Homepage": "https://github.com/ipazc/mtcnn",
"Source": "https://github.com/ipazc/mtcnn",
"Tracker": "https://github.com/ipazc/mtcnn/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc7e0b2b688a9e2d353a661b617b12d00d9af29f877b57c8e4a3cbe447483b46",
"md5": "f789c355204fd7dfd315dc39a79fd387",
"sha256": "0a96b4868e56db9ae984449519642be6dba03240e608a67e928ebb47833e9144"
},
"downloads": -1,
"filename": "mtcnn-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f789c355204fd7dfd315dc39a79fd387",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 1898606,
"upload_time": "2024-10-08T01:42:18",
"upload_time_iso_8601": "2024-10-08T01:42:18.271058Z",
"url": "https://files.pythonhosted.org/packages/dc/7e/0b2b688a9e2d353a661b617b12d00d9af29f877b57c8e4a3cbe447483b46/mtcnn-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6737b0f60411b6a37dcd5122bbe05c9aa45f271bcc8129caa45ee1012251905d",
"md5": "76b0a158169879c60a32c49f0679bc04",
"sha256": "08428bf8e1ae9827d43a40bb0246b57f2239e3572d3742f472ae9924896c6419"
},
"downloads": -1,
"filename": "mtcnn-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "76b0a158169879c60a32c49f0679bc04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 1885746,
"upload_time": "2024-10-08T01:42:22",
"upload_time_iso_8601": "2024-10-08T01:42:22.685358Z",
"url": "https://files.pythonhosted.org/packages/67/37/b0f60411b6a37dcd5122bbe05c9aa45f271bcc8129caa45ee1012251905d/mtcnn-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 01:42:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ipazc",
"github_project": "mtcnn",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "joblib",
"specs": [
[
">=",
"1.4.2"
]
]
},
{
"name": "lz4",
"specs": [
[
">=",
"4.3.3"
]
]
}
],
"lcname": "mtcnn"
}