All Projects → wondonghyeon → Face Classification

wondonghyeon / Face Classification

Face model to classify gender and race. Trained on LFWA+ Dataset.

Projects that are alternatives of or similar to Face Classification

Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (+609.62%)
Mutual labels:  jupyter-notebook, face-detection, face-recognition
Insightface Just Works
Insightface face detection and recognition model that just works out of the box.
Stars: ✭ 127 (+22.12%)
Mutual labels:  jupyter-notebook, face-detection, face-recognition
Deep Face Recognition
One-shot Learning and deep face recognition notebooks and workshop materials
Stars: ✭ 147 (+41.35%)
Mutual labels:  jupyter-notebook, face-detection, face-recognition
Sphereface
Implementation for <SphereFace: Deep Hypersphere Embedding for Face Recognition> in CVPR'17.
Stars: ✭ 1,483 (+1325.96%)
Mutual labels:  jupyter-notebook, face-detection, face-recognition
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+2387.5%)
Mutual labels:  jupyter-notebook, face-detection, face-recognition
Object face detection webcam react
Face/Mood detection using face-api.js
Stars: ✭ 29 (-72.12%)
Mutual labels:  face-detection, face-recognition
Compreface
Free and open-source face recognition system from Exadel
Stars: ✭ 947 (+810.58%)
Mutual labels:  face-detection, face-recognition
Facerecog
Face Recognition using Neural Networks implemented using Keras
Stars: ✭ 39 (-62.5%)
Mutual labels:  jupyter-notebook, face-recognition
Opencv Face Filters
Snapchat-like Face Filters in OpenCV
Stars: ✭ 51 (-50.96%)
Mutual labels:  face-detection, face-recognition
Tensorflow Lite Rest Server
Expose tensorflow-lite models via a rest API
Stars: ✭ 43 (-58.65%)
Mutual labels:  jupyter-notebook, face-detection
Facenet Face Recognition
This is the research product of the thesis manifold Learning of Latent Space Vectors in GAN for Image Synthesis. This has an application to the research, name a facial recognition system. The application was developed by consulting the FaceNet model.
Stars: ✭ 54 (-48.08%)
Mutual labels:  jupyter-notebook, face-recognition
Helloface
An awesome face technology repository.
Stars: ✭ 905 (+770.19%)
Mutual labels:  face-detection, face-recognition
Deepcamera
Open source face recognition on Raspberry Pi. SharpAI is open source stack for machine learning engineering with private deployment and AutoML for edge computing. DeepCamera is application of SharpAI designed for connecting computer vision model to surveillance camera. Developers can run same code on Raspberry Pi/Android/PC/AWS to boost your AI production development.
Stars: ✭ 757 (+627.88%)
Mutual labels:  face-detection, face-recognition
Realtimefacedetection
基于YOLO-lite的web实时人脸检测,tfjs人脸检测,目标检测
Stars: ✭ 38 (-63.46%)
Mutual labels:  jupyter-notebook, face-detection
Human Detection And Tracking
Human-detection-and-Tracking
Stars: ✭ 753 (+624.04%)
Mutual labels:  face-detection, face-recognition
Face Identification With Cnn Triplet Loss
Face identification with cnn+triplet-loss written by Keras.
Stars: ✭ 45 (-56.73%)
Mutual labels:  jupyter-notebook, face-recognition
Ai Reading Materials
Some of the ML and DL related reading materials, research papers that I've read
Stars: ✭ 79 (-24.04%)
Mutual labels:  face-detection, face-recognition
Face Recognition Cpp
Real Time Face Recognition Detector. Over 30FPS on CPU!
Stars: ✭ 68 (-34.62%)
Mutual labels:  face-detection, face-recognition
Insightface
State-of-the-art 2D and 3D Face Analysis Project
Stars: ✭ 10,886 (+10367.31%)
Mutual labels:  face-detection, face-recognition
Pyseeta
python api for SeetaFaceEngine(https://github.com/seetaface/SeetaFaceEngine.git)
Stars: ✭ 93 (-10.58%)
Mutual labels:  face-detection, face-recognition

Gender and Race Classification with Face Images

Let's train a simple face attribute classification model! The dataset we are going to use contains 73 different face attributes, but we are only going to focus on gender and race. Here are some sample results of the trained model. (For now, the dataset I used has only "White," "Black," and "Asian" faces. I will try to add more races in future)

Ellen's Oscar Selfie Trump Rally Korean Protest

Requirements

Packages

dlib
face_recognition
NumPy
pandas
scikit-learn

Dataset

LFWA+ dataset

Usage

Data Preprocessing

Download Dataset

You can download LFWA+ dataset here. You will see a Dropbox link for LFWA+ dataset in this page. Please unzip the lfw.zip file after you download.

Feature Extraction
python feature_extraction.py --data_dir LFWA/ --save_feature feature.csv --save_label label.csv

You can run feature_extraction.py like the above command or just run the jupyter notebook (feature-extracion.ipynb) step by step.

We are going to use the face embedding function face_encodings in face_recognition package, which is based on dlib's face_recognition_model_v1. This function takes a face image as input and outputs a 128-dimensional face embedding vector. This function is basically an implementation of Face-Net, a deep CNN trained with triplet loss. Please refer to the original paper for more details

For face detection, I just used face_recognition's face_locations. This is a histogram of oriented gradient (HOG), which is quite outdated, by default. You can use a CNN face detector by changing input parameters in line 49 of feature_extraction.py and line 20 of pred.py like the follwing

# line 49 of feature_extraction.py
X_faces_loc = face_locations(X_img, model = "cnn")
# line 20 of pred.py
locs = face_locations(X_img, number_of_times_to_upsample = N_UPSCLAE, model = "cnn")

Model Training

python train.py --feature feature.csv --label label.csv --save_model face_model.pkl

You can run train.py as above or just run the jupyter notebook (train.ipynb) step by step.

I used MLPClassifier in sklearn package for the classifier. You can change it to the classifier of your flavor but I like MLPClassifier since it is really simple!

Prediction

Classify face attributes for all images in a directory using pred.py

python pred.py --img_dir test/ --model face_model.pkl

More Examples!

blm women's march g20 grammy volleyball baskettball obama I love Obama.. Please don't get me wrong! real madrid sanders

Future Works

  • [ ] Add more data (Google Image Search)
  • [ ] Use a better face detection model (faster rcnn)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].