-
Notifications
You must be signed in to change notification settings - Fork 5
2.2 Tutorials on using the Vision Blocks
Face recognition is one of the most commonly used A.I. algorithms nowadays. It works by comparing a person's face in front of a camera with a built-in database. If the person's face matched an entry in the database, then the system can automatically retrieve the person's profile and perform other actions, such as opening a door. Currently, the most accurate face recognition algorithms are all deep-learning based. CAIT also provides state-of-the-art deep learning-based face recognition for you.
The face recognition blocks in CAIT consist of three blocks:
-
recognize face: You can use this block to recognize a person in front of the camera. It first detects the location of the person's face in the image captured by the camera, then passes this face image through a deep neural network to generate a feature vector. This feature vector is then used to compare with the feature vectors of different people in the database; if a match is found, the block will return the name of the match and the image coordinate of this person's face in the image. If there is no match, the block will return "Unknown" as the person's name.
-
add person with name: You can use this block to add a face image into the face recognition database.
-
remove person with name: You can remove a person from the face recognition database.
You have used the first 2 blocks in Quick Start. Below is an example of using the remove person with name block.
From the Quick Start guide, I have added myself to the database so that CAIT can recognize my face, as shown in the diagram below.
Now, enter the program shown below.
Run it, and now CAIT will not recognize me anymore. Like the add person with name block, you only need to run the remove person with name block once for every person you wish to remove from the database.
Object detection is another commonly used A.I. algorithm. Given an image, an object detection model can recognize various kinds of objects present in the image as well as compute their location in the image. This is very useful for robotic systems. CAIT provides an object detector based on the deep-learning method and can detect 90 classes of objects.
Below is a program that uses the detect objects block to detect objects.
After you run the program, you should see something like below.
Like object detection, an image classification algorithm also predicts the type/class of an image, except that it will not output the object's location. For any image, it will only predict the whole image into one type/class of object, regardless of the location of the predicted object in it. CAIT provides an image classifier that can predict 1000 types/classes. Please scroll down in the linked Python file to find the definition of all 1000 classes.
Below is a program that uses the classify image block to classify the camera frame.
After you run the program, you should see something like below.