mtcnn
Multitask Cascaded Convolutional Networks for face detection and alignment (MTCNN) in Python >= 3.10 and TensorFlow >= 2.12
What it is and what it does
MTCNN is a face detection and alignment library that uses a three-stage cascaded convolutional network (PNet, RNet, ONet) to locate faces in images and extract facial landmarks. It returns bounding boxes and keypoint coordinates (eyes, nose, mouth) for each detected face along with confidence scores. The package is designed for Python >= 3.10 and requires TensorFlow >= 2.12 as its primary external dependency.
The library provides a simple API: instantiate an MTCNN detector, load an image, call detect_faces(), and receive structured output with box coordinates, landmark positions, and confidence values. Maintenance is dormant but the codebase is stable; the repository has not been archived and retains 2483 stars. No known vulnerabilities are recorded.
Use it for:
- Detect faces in photos for automated cropping, tagging, or privacy masking in image processing pipelines.
- Extract facial landmarks to feed into downstream face recognition or emotion detection models.
- Build face-aware image galleries or applications that need to locate and align faces.
- Perform batch face detection on large image datasets for training or annotation workflows.
- Implement face detection in video frames for security or interactive applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects faces and facial landmarks (eyes, nose, mouth) in images using a cascaded convolutional network, returning bounding boxes and keypoint coordinates.
Yes, if you need face detection and landmark extraction in Python >= 3.10. The package has low install friction, permissive licensing, no known vulnerabilities, and a stable codebase with 2483 GitHub stars. The main trade-off is dormant maintenance—no active development for 675 days—so expect no new features or rapid bug fixes. It is suitable for production use in stable environments but not for projects requiring ongoing support.
Install
mtcnn on PyPI
pip
pip install mtcnnuv
uv add mtcnnpoetry
poetry add mtcnnInstalling mtcnn
Before you install
Low friction installation with only joblib and lz4 as runtime dependencies. Maintenance is dormant—last release was 675 days ago—but the repository remains active with 2483 stars and has not been archived, suggesting the package is stable rather than actively developed.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install mtcnn
from mtcnn import MTCNN
from mtcnn.utils.images import load_image
detector = MTCNN(device="CPU:0")
image = load_image("photo.jpg")
result = detector.detect_faces(image)
print(result)
Requires Python >= 3.10 and TensorFlow >= 2.12; TensorFlow must be installed separately or via pip install mtcnn[tensorflow].
Verify before relying
- Whether the package's performance characteristics (speed, accuracy) meet your application's requirements compared to alternatives.
- GPU device support and whether CUDA/GPU acceleration is available beyond the CPU:0 example shown.
- Batch processing capabilities and performance characteristics on large image datasets.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — joblib, lz4 |
| Maintenance | dormant — 675 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,806,628/month — #2,493 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mtcnn-1.0.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
face-alignmentDetects 2D and 3D facial landmarks from images…
permissive · top 15,000 on PyPI
retina-faceDetects faces in images and extracts facial…
permissive · top 15,000 on PyPI
facenet-pytorchProvides pretrained PyTorch models for face…
permissive · top 15,000 on PyPI
face-recognitionDetects, locates, and identifies faces in…
permissive · top 15,000 on PyPI
facexlibFacexlib provides a collection of PyTorch-based…
permissive · top 5,000 on PyPI
retinaface-pyDetects and localizes faces in images using a…
permissive · top 15,000 on PyPI
face_recognition_modelsProvides pre-trained deep learning models for…
permissive · top 15,000 on PyPI
deepfaceDeepFace performs face recognition,…
permissive · top 15,000 on PyPI
tmtoolsProvides Python bindings to the TM-align…
copyleft · top 15,000 on PyPI
gfpganGFPGAN restores and enhances degraded faces in…
permissive · top 15,000 on PyPI