Welcome back to the OpenVINO Channel
This is another interesting demo you can use to see how -We use multiple models running in parallel in the system
And of course you can run them on different devices..
One on CPU, one on GPU and so on..
We have here face detection, action detection as you have seen in previous demos
But in this demo you could also see how we do face recognition.
We give the system a face image and look for this specific face..
Let's Initialize OpenVINO I'm building a sample directory,
And building here the smart-classroom sample..
define $models as a pointer to the Intel provided pre-trained models.
Running the sample is easy. -m_act is a model for the action detection
-m_fd is the face detection model -m_lm is the face landmarks model
-m_reid is the re-identification model.
And you can see that we detect the faces and the full person
We also detect if they are standing, sitting or raising their hands..
A quick look at the code, you can open the main.cpp in the sample directory..
Scroll down to line 280 And see how each of the CNN models is being initialized, And configured.
The action detector, the face detector and so on..
You can see here how the faces are extracted from each frame..
And the list of actions..
And you see how the face region-of-interest is handed to the landmark detection model
which extracts the specific features for this face..
And how the features, are used to align the face and for re-identifying people in the frame.
In order to perform face recognition, we need to create a face gallery..
I'll put a bunch of cropped small face images in a face-gallery directory.
Each image should be called name.number.png
For example guy.0.png is my first image
I could add guy.1.png, guy.2.png etc to improve the recognition accuracy..
I will call this guy ALEX..
Now we need to run a python script to create a JSON list..
You can see that the .json file was created..
And now we run the sample again..
With -fg directing to our face gallery JSON file..
And you can see that ALEX is detected..
It's pretty slow, 12 frames per seconds As all of these models are running on my CPU
As always you can change the target device,
Here I will try to run the landmark detection and the re-identification models on the GPU
And we improved from 12 to 19 frames-per-seconds. And the CPU is free
This sample could be a good start if you need a simple face detection and recognition, action detection and tracking..
Use it. it's free
Thank you