April 03, 2023
According to Test Blog #1, I found it is not enough for me to continue building the system not only because of the simple data set but also the data I want to collect.
So I keep researching and finally found this library called deepface which is a lightweight face recognition and facial attribute analysis (age, gender, emotion and race) framework for python. It is a hybrid face recognition framework wrapping state-of-the-art models: VGG-Face
, Google FaceNet
, OpenFace
, Facebook DeepFace
, DeepID
, ArcFace
, Dlib
and SFace
.
It is also easy to get access to a set of features:
I used Colaboratory - Google to test around this library(also my first time using colab) and followed the tutorial: DeepFace: State-of-the-Art Face Attribute Analysis in Python, here is my work flow:
!pip install deepface
from deepface import DeepFace
import matplotlib.pyplot as plt
import cv2
import pandas as pd
from google.colab import drive
drive.mount('/content/drive')
backends = [ 'opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface', 'mediapipe']
face = DeepFace.detectFace('/content/drive/MyDrive/Siri_Images/IMG_0171.jpg', target_size = (224, 224), detector_backend='opencv')
plt.imshow(face)