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-frontal-face-detector
The reader is supported on Python 3.6 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
>>> image = largest_face_detector.detect_largest_face('image.jpeg')
$ Cropped face saved successfully at : /Users/kulshd/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 downloading source .tar.gz file (https://pypi.org/project/largest-frontal-face-detector/1.0.0/#files) ,extracting and cd into folder largest_frontal_face_detector-1.0.0, 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file largest_frontal_face_detector-1.0.0.tar.gz.
File metadata
- Download URL: largest_frontal_face_detector-1.0.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2feca4ce0ef976a83916999d65644e7ba25d00935db8f9dfa130b7bd9473b59
|
|
| MD5 |
e7945f231b46bba8cbbd8f73a9a41887
|
|
| BLAKE2b-256 |
8c29827790993f9791316d16c07fcdd8552e0b94ecb9099abab8907f09e381af
|
File details
Details for the file largest_frontal_face_detector-1.0.0-py3-none-any.whl.
File metadata
- Download URL: largest_frontal_face_detector-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df6ff2602fc22691b019212790ecec1f48f6d98e3f6e4877a59815917d01f77f
|
|
| MD5 |
74415bf77ded42ec754434504f3a687e
|
|
| BLAKE2b-256 |
36444d0e4aebb8ffb7492be2e5d85e04a9dfc93522218d29c7752090e3a33ee3
|