CODEX

iOS Real-time Face Recognition Application based on FaceNet

Tuan Ho Si
CodeX
Published in
6 min readMar 27, 2021

--

In this article, I will tell you how to develop a simple iOS app can recognize face with high accuracy. I have tested with 70 users.

The ability to recognize of this application is based on a pre-trained FaceNet model “has been trained on the VGGFace2 dataset consisting of ~3.3M faces and ~9000 classes”.

But, how to use FaceNet in iOS device is the main problem. Because I’m just a iOS dev and don’t have experience in Machine Learning or Image Processing, I have been struggling with it in a long time.

In the first time, I try to train a classification model by Create ML tool, it’s quite easy. Just create two folders for two classes, then drag it to Training Data and start “Train”. Wait and export to *.mlmodel file. You can read Apple document for tutorial.

The model working well, but when I have more than 3 users, it give me wrong result. Ignore it!

Create ML screenshot

--

--

Tuan Ho Si
CodeX
Writer for

iOS Developer. Think different. I am just a newbie in iOS Development, Machine Learning and Computer Vision. I just wanna share what I know as a newbie.