EraGenes is basically the combination of two latin words Era means age and Genes means gender.
This project is basically about Extracting the basic key features from Human faces in Real time.
Use this link to download this project directly from google drive which consist of 5 minutes of demo vedio in high resolution:
https://drive.google.com/open?id=16TT7O2Kb20PA_Fw46uqiIIFpt1L7GNtC
1.Introduction
2.Project Specification
3.Installing Dependencies
4.Strategy
5.Python files
6.How to run
7.Output Snapshot
1.python3
2.Linux based Platform (works on windows too).
3.Requires high level of computational processor.
4.must have updated gnu-g++ compiler.
5.Cmake (latest version)
1.scikit-learn
2.dlib
3.matplotlib
4.opencv(cv2)
5.keras
6.math
7.h5py
Before installing the dependencies i would suggest to update and uprade to your system by the following command:
sudo apt-get update && dist-ugrade;
use of pip command
1.pip install package_name --upgrade
use the below command
pip install -r spec.txt
The above command will install all the required dependencies using spec.txt file.
The first step is to detect the face in the given Image or a frame.
The best way is to Use Haarcascade classifier algorithm .
The algorithm itself can be hard to understand but actually it is following the basic strategy i.e finding a feature pixel by pixel.
wheh it finds the first features it goes for onother one with more confidence .the algorithm runs in a loop until frame size is finshed.if all the facial features are found then it returns the coordinates TOP LEFT AND BOOTOM RIGHT.
The working of the above algorithm looks somewhat like this:
Now the face is been detected its time to move the next strategy.
To extract the facial features we are using convolution neural network.It is a advanced machine learning algorithm that is used in the feild of computer vision.
This features are used to define the age and gender classification.
What is facial key points and landmarks?
ans
This section is about the different python files used for building the project. $ipython3 dataset.py this python file is used to build a raw dataset form bunch of image dataset.
Well let me explain you .
If you take a image you will find out that the each image is set of pixels and each pixels are in the form of [ R, G, B] so, it is hard to do the analysis.which brings us to the file.
this python code follows certain steps:
1.face cropping
using below python file:
$ipython3 cropfunc.py
The image is been cropped and resised to (64 x 64) dimension of image.
2.grayscale conversion
3.wirting the pixels to the dataset
Now that we have created our dataset it is the time for machne learnng analysis for that we are using the follwing python code:
$clf.py
dataset variation with pixels
Pie chart
Machine learning (Regression)
X axis : Learning Acuuracy
Y axis : Learning Loss
Before running the program make sure you have provided the corect path of haarcascade and the other classifiers.
Here are the lis of classifier used in the project :
1.haarcascade_eye.xml
2.haarcascade_frontalface_default.xml
# 1 and two used in demo.py file and main.py file
3.gclf.pkl
# used in main.py file
4.shape_predictor_68_face_landmarks.dat used in main and demo.py file
5 pretrained model file used in demo.py file.\
Note :do not need to change the path of file except the demo.py file if you want to use the pretrained files.
finally to run the file make sure you have updated system with installed all the dependencies with webcam connected.
run the below command:
$ ipython3 newmain.py
if all went well you will see the desired responses.
NOTE: I am using ipython3 version to run the program .if you want you can use others too such as : python,python3 etc.
If all went well you will see the output like below.
As you can see the output is working with slightly variance, this can be happening because of some reasons such as :
1.Bad Training.
2.Bad Feature Selection.
3.Noise.
But as you can see the facial key points are very much accurate.when i kept my mouth closed , fitted properly but when i tried to open it,the facial key points moved accordingly .
I guess that is the beauty of Machine intelligence .