Day 86 – Deep Learning Image Face Detection In Less Than A Min Using RetinaFace

Face detection, Facial recognition, and Facial expression recognition are popular nowadays after Artificial Intelligence.

iPhone was introduced on their phone, and many apps have these features.

I will show you how to detect face areas in the image in less than 25 lines of code.

I will use the RetinaFace DeepLearning library to detect all faces on the image.

What is RetinaFace?

RetinaFace is a deep learning based cutting-edge facial detector for Python coming with facial landmarks.

Source: RetinaFace

I am going to use Google Colab, and you can see the code here.

Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Crowd of masked people
Copy to Clipboard
Copy to Clipboard

{‘score’: 0.9997192025184631, ‘facial_area’: [209, 83, 327, 250], ‘landmarks’: {‘right_eye’: [225.48073, 154.06593], ‘left_eye’: [277.90686, 148.1564], ‘nose’: [243.96909, 187.55666], ‘mouth_right’: [241.50496, 217.94543], ‘mouth_left’: [278.17957, 213.22757]}}
{‘score’: 0.9996291399002075, ‘facial_area’: [350, 95, 496, 300], ‘landmarks’: {‘right_eye’: [382.1355, 172.75745], ‘left_eye’: [445.83966, 169.52275], ‘nose’: [407.87024, 212.00275], ‘mouth_right’: [394.29565, 249.37596], ‘mouth_left’: [440.78555, 246.39479]}}
{‘score’: 0.9996178150177002, ‘facial_area’: [79, 100, 181, 242], ‘landmarks’: {‘right_eye’: [98.006485, 156.73376], ‘left_eye’: [147.02284, 155.76279], ‘nose’: [116.42045, 185.39218], ‘mouth_right’: [105.199776, 212.61584], ‘mouth_left’: [140.5728, 212.04578]}}
{‘score’: 0.9990742206573486, ‘facial_area’: [560, 104, 741, 342], ‘landmarks’: {‘right_eye’: [618.5633, 196.25557], ‘left_eye’: [700.45, 197.64638], ‘nose’: [663.01984, 244.12181], ‘mouth_right’: [627.3689, 287.5204], ‘mouth_left’: [687.887, 287.70456]}}
{‘score’: 0.9965476393699646, ‘facial_area’: [1, 81, 94, 209], ‘landmarks’: {‘right_eye’: [26.9971, 133.53793], ‘left_eye’: [67.458115, 129.10698], ‘nose’: [51.27739, 159.16124], ‘mouth_right’: [40.50979, 182.45554], ‘mouth_left’: [69.29862, 178.991]}}

Copy to Clipboard
Copy to Clipboard
crowd-of-masked_face_detection
Detect and extract individual faces from the image
Copy to Clipboard
By |2021-07-13T22:19:42+00:00July 13th, 2021|Artificial Intelligence|0 Comments

About the Author:

Leave A Comment