Skip to main content

opensource wrapper library for face detection algorithms and other utilities

Project description

face utils

this is an opensource wrapper library for the most common face detection models.

It also provides multiple face utilities such as face cropping.

Supported detection models

  • face_recognition (hog and cnn)
  • retina face model
  • haar cascade face detection

more to be added in the next releases

Installation

OS X & Linux using PIP :

pip install face-utils

Features

Face Detection

By creating an object of the face detection model you want you can use it to detect the faces in images.
I have also implemented outputs forms such as 1 : (x,y,w,h) and 2 : (top,right,bottom,left )

Face cropping

ability to crop the face from the image given the detector result
You can also zoom in and out from the face.

Example

import cv2
from face_utils.detection import Detector
from face_utils.cropping import cropping
imgPath = "files/Obama.jpg"
img = cv2.imread(imgPath)
img= np.array(img)
model = Detector("hog")
bbox = (model.detect(img,2)) #using (x,y,w,h) return mode
face = cropping.crop(img,bbox,1,80,80)

input :

output :

TODO::

  • add images loading function (opencv and PIL)
  • add multiple faces detection for retina face model
  • add x1,y1,x2,y2 for detection module
  • add encoding feature
  • add shape drawing around faces
  • add test scripts

Release History

  • 0.0.1
    • three detection models with one simple cropping module

License

MIT

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

face-utils-0.0.3.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

face_utils-0.0.3-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file face-utils-0.0.3.tar.gz.

File metadata

  • Download URL: face-utils-0.0.3.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for face-utils-0.0.3.tar.gz
Algorithm Hash digest
SHA256 dd6db59b61aa8e2ac4d5439c78068e888ee77515d1b571d4efe27ace745af670
MD5 439b87dae10815b05d732c9e70b6c9e6
BLAKE2b-256 2b0c9de546bcab766a111f594ea6208e72e2b1589fa9c2ba87e53b68738e242a

See more details on using hashes here.

File details

Details for the file face_utils-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: face_utils-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for face_utils-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b74e7f001d23b785ef074a69ac7d5565ffb5df19fffb775bbcc0a5b751d67e10
MD5 264d01ed0275df7abf6e3a7b64f921af
BLAKE2b-256 17cb80032c185d03c4ace89cbc7dca237be3e67ca5f0ae2e23e4283876741bd7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page