icub-client
Face Recognition Tutorial: Collecting data and training

This provides a tutorial on how to create your own face recognition model with SAM. More...

This provides a tutorial on how to create your own face recognition model with SAM.

Prerequisites

To follow this tutorial you need to have:

Data Collection

Step 1: First run:

CLMYarp --from $CLM_MODEL_DIR 
yarp connect <imagePort> /CLM/image/in udp+mjpeg 

where <imagePort> is the yarp port sending images from a camera. Example one of the icub's eyes /icub/cam/left or a webcam using yarpdev opencv_grabber. The above instructions launch and connect CLMYarp and you should start seeing segmented faces shown on screen. At this point prepare the subject to be recorded in front of the camera being used.

Step 2: Go to SAM_Data_Models/Data/<myFacesFolder> directory from the terminal and from this directory run

yarpdatadumper --name /samRecogDumper/faces_in --type image --rxTime --dir <faceName>
yarp connect /CLM/imageSeg/out /samRecogDumper/faces_in udp

where <faceName> is the name of the person being recorded. As soon as you make the connection, open your file manager and monitor the amount of images being stored. Terminate yarpdatadumper when the amount of required images is reached: 300-500 images is usually a good amount for training.

Repeat Step 2 for each person that is to be trained, changing <faceName> each time such that each person has a separate images folder

Training

For training, run samSupervisor.py from the command line and connect to it using

yarp rpc /sam/rpc:i 

Then if you send a check_all command you should see <myFacesFolder> listed as available for training. To train, send a train <myFacesFolder> command and this will perform the training.

(This page can be edited at src/doc/facerecognitiontutorial.dox)