MTCNN face detection implementation in Tensorflow Lite.
Project description
MTCNN face recognition
Implementation of the MTCNN face detection algorithm. This project converted the code from ipazc/mtcnn to TF Lite.
Installation
You can install the package through pip:
pip install mtcnn-tflite
Quick start
Similar to the original implementation, the following example illustrates the ease of use of this package:
>>> from mtcnn_tflite import MTCNN
>>> import cv2
>>>
>>> img = cv2.cvtColor(cv2.imread("ivan.jpg"), cv2.COLOR_BGR2RGB)
>>> detector = MTCNN.MTCNN(image_dimension=(561,561))
>>> detector.detect_faces(img)
[
{
'box': [276, 88, 51, 68],
'confidence': 0.9989245533943176,
'keypoints': {
'left_eye': (291, 117),
'right_eye': (314, 114),
'nose': (303, 130),
'mouth_left': (296, 143),
'mouth_right': (314, 141)
}
}
]
Benchmark
Image size | TF version | Process time * |
---|---|---|
561x561 | TF2 | 698ms |
561x561 | This repository (TF Lite) | 445ms |
* executed on a CPU: Intel i7-10510U
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mtcnn_tflite-0.0.2.tar.gz
(2.3 MB
view hashes)
Built Distribution
Close
Hashes for mtcnn_tflite-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d60e76d8ba3d6019e198dde173dab9f11adb6b7cd596bfbf523d6820103fda03 |
|
MD5 | 5d1a8dd9947311e3553da2d3866bf3d8 |
|
BLAKE2b-256 | 2ecffc1d8634f65ff8333469a20e973282d0997405011424afa085dd901833b2 |