This Package used for Face Recognition with Machine Algorithm
Installing Steps for requirements python package
Installing dlib on Ubuntu
The following instructions were gathered on Ubuntu 16.04 but should work on newer versions of Ubuntu as well.
To get started, let’s install our required dependencies:
sudo apt-get update
sudo apt-get install build-essential cmake
sudo apt-get install libopenblas-dev liblapack-dev
sudo apt-get install libx11-dev libgtk-3-dev
sudo apt-get install python python-dev python-pip
sudo apt-get install python3 python3-dev python3-pip
after
pip install dlib
Installing pyfacy models on Ubuntu
pip install pyfacy_dlib_models
Installing imutils on Ubuntu
pip install imutils
Installing numpy, scipy and sklearn
pip install numpy
pip install scipy
pip install scikit-learn
Examples:
Read Image
from pyfacy import utils
img = utils.load_image('<image src>')
ex:
img = utils.load_image('manivannan.jpg')
Face Encodings:
from pyfacy import utils
img = utils.load_image('<image src>')
encodings = utils.img_to_encodings(img)
Compare Two faces
from pyfacy import utils
image1 = utils.load_image('<image1 src>')
image2 = utils.load_image('<image2 src>')
matching,distance = utils.compare_faces(image1,image2)
Note: The compare_faces return Boolean and Distance between two faces
Example for Face Recognition using ML
Implementing Algorithms
- KNN - K-Nearest Neighbors
- LOG_REG_BIN - Logistic Regression with two classes
- LOG_REG_MUL - Logistic Regression with more than two classes
- LDA - Linear Discriminant Analysis
Training , Save model and Predict Image
from pyfacy import face_recog
from pyfacy import utils
mdl = face_recog.Face_Recog_Algorithm()
# Train the Model
# Implemented only four algorithms above mentioned and put the shortform
mdl.train('pyfacy/Test_DS',alg='LOG_REG_MUL')
# Save the Model
mdl.save_model()
# Predicting Image
img = utils.load_image('<image src>')
mdl.predict(img)
Loading model and Predict Image
from pyfacy import face_recog
from pyfacy import utils
mdl = face_recog.Face_Recog_Algorithm()
# Load Model
mdl.load_model('model.pkl')
# Predicting Image
img = utils.load_image('<image src>')
mdl.predict(img)
Face Clustering
Cluster the image_src
from pyfacy import face_clust
# Create object for Cluster class with your source path(only contains jpg images)
mdl = face_clust.Face_Clust_Algorithm('./pyfacy/cluster')
# Load the faces to the algorithm
mdl.load_faces()
# Save the group of images to custom location(if the arg is empty store to current location)
mdl.save_faces('./pyfacy')
Metadata
Release files for pyfacy 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfacy-1.0.1.tar.gz | 6.1 kB | Without provenance | Details for pyfacy-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfacy-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pyfacy-1.0.1-py3-none-any.whl |
Total release size: 13.5 kB
Release files / pyfacy-1.0.1.tar.gz
| Download URL | pyfacy-1.0.1.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd8b27dc69cddfba1cf244012c2b04d43eafcef1eb11ab88787c350326945a76
|
|
BLAKE2b-256 checksum How to use checksums |
897f944bcadb7290309f622afa5f4f4b0f446cac07ec7ac60a872f7c34982c8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyfacy-1.0.1-py3-none-any.whl
| Download URL | pyfacy-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8926e55746268d3cbd711d8c4b39b84faa74215477c8ab2b2fcfa610438c12d5
|
|
BLAKE2b-256 checksum How to use checksums |
28f46923c32c8725e9f0aa875e7b6fdfc0221d848d13d35d504c5b8cbf629ba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyfacy 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.