Python pakage for detecting largest face in an image
Project description
Largest Face Detector
The Largest Face Detector is a basic face detector that detects largest frontal face from image using external python dlib library (http://dlib.net/python/index.html).
Installation
You can install the Largest Face Detector from PyPI:
pip install largest-face-detector
The reader is supported on Python 2.7, as well as Python 3.4 and above.
Pre-requisites
1. numpy (pip install numpy)
2. dlib (pip install dlib)
3. PIL (pip install pillow)
NOTE :: These dependency packages will be installed automatically upon installing largest-face-detector package.
How to use
The Largest Face Detector is a pip package, named largest_face_detector
. To detect face in a particular image, call the function detect_largest_face
with image path as input (relative to current directory you are in)
>>> import largest_face_detector
>>> largest_face_detector.detect_largest_face('image.jpeg')
$ Cropped face saved successfully at : /Users/kulshd/projects/largest_face_detector/2019-10-05T14:08:20.086934_cropped_image.jpeg
The function will return the cropped image as a 2D numpy array and also save it.
Following are some requirements and assumptions for using this package -
1. Image size must be within [1024,1024]. If it exceeds, NotImplementedError is raised.
2. If no face is detected by the package, a warning message is displayed
3. Currently following image formats are supported - [.jpeg, .jpg, .png]
You can also run test-cases to validate package functionality by going to package directory, and running python3 -m unittest discover -v
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
Built Distribution
Hashes for largest_frontal_face_detector-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fc8b145e002ebf4a4e73496b9574f159d7f283ee8b2a1fc34dd1da299a15316 |
|
MD5 | 43d174b1d8ae541437fb3fbd9cb0405d |
|
BLAKE2b-256 | 88e53cc8007918acc86d72ff6861f627df937d205aa4e27f0dae3b7f1e6e46f2 |
Hashes for largest_frontal_face_detector-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e45a0322b1d6f87b3478d2d0b6cb24a499ab0632b8f1cc4c05e1cad028e8402 |
|
MD5 | c314a07ec699a67f07ec23dbc948ded3 |
|
BLAKE2b-256 | f17144c3aad822ee05fecb0d477ca5fa166836c82130bff166adc0e6224a40e8 |