facereg
facereg is a module for face recognition with OpenCV and Deep Learning.
For now it can be used for just images. It is easy to use with a handy feature which downloads images from Google for you with given keywords to create dataset/s.
Uses two different technics CNN and HoG for recognition based on dlib’s face recognition system with using face_recognition. facereg has totally three different layers and only recognizer has connection on encoder.
Prerequisites
All dependencies are listed on requirements.txt and will be installed when you install with pip.
Installation
Install module using pip:
$ pip install facereg
Download the latest facereg library from: https://github.com/verifid/facereg and install module using pip:
$ pip install -e .
Extract the source distribution and run:
$ python setup.py build $ python setup.py install
Usage
google_images:
import os
from facereg import google_images
output_directory = os.getcwd() + '/datasets' # directory path where you want to save photos
image_paths = google_images.download('michael jordan', limit=3)
face_encoder:
import os
from facereg import face_encoder
datasets_path = os.getcwd() + '/datasets'
encodings_path = os.path.dirname(os.path.realpath(__file__)) + '/encodings.pickle'
# these are default values for this method
face_encoder.encode_faces(datasets=datasets_path, encodings=encodings_path, detection_method='cnn')
recognize_faces:
from facereg import recognize_faces
image_path = 'DIRECTORY PATH OF YOUR_IMAGE'
names = recognize_faces.recognize(image_path)
# returns found names from your datasets
CLI Usage
Download images
# -d: keyword, -l: limit
$ python -m facereg -d 'michael jordan'
$ python -m facereg -d 'michael jordan' -l 5
Recognition
# -i: Directory path for image
$ python -m facereg -i tests/resources/michael_jordan.jpeg
Sample Result
Metadata
Release files for facereg 0.2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| facereg-0.2.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Release files / facereg-0.2.1.2-py2.py3-none-any.whl
| Download URL | facereg-0.2.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
80d9f779e6dd2c237eb1fd7e1bd74410e80011b1ecb73abecf8b6d4a397c7de3
|
|
BLAKE2b-256 checksum How to use checksums |
8b3bb395a904872eed3b451c43df8652acbf64b3ad4672855f9f39a9a2477fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5
|