Robot Not a Dev? Buy Now
Not a Dev?

Misty Community Forum

FaceDetection example?

I’m trying to get my Misty to recognizes faces and am not getting any results.

Here’s the simple Javascript I’ve setup:

_robo1.Connect();

setTimeout(function(){
    _robo1.RunFaceDetectionProcess(function(data){
        console.log("face detected event", data);
    });
}, 1000);

// put my face in front of the camera

setTimeout(function(){
    _robo1.UnsubscribeToFaceDetectionEvents();
}, 10000);

I never get any face detection events though. I’ve also tried calling _robo1._MistyAPI.GetLearnedFaces() afterwards and it never returns any faceIDs and data.

The blue light on the video camera on top of my Misty is on and I look right at the camera.

I’m not completely sure I’m making the right API calls though. Can someone give an example of how the FaceDetection is supposed to work?

Thanks!

Hi Cameron,
I am sending you a new robot build and API Client with some recent face detection/recognition and websocket updates. This is a work in progress, so you will see more improvements soon, but please let us know if you see any issues or think of things to make it better.

If you have trouble getting face detection to work using the current websocket request, you should be able to use the disposition style request that face rec uses (with different data filtering) for now.

The general steps for getting a face recognized is as follows:

  1. Make sure the 820 is on and the light on the camera is solid blue.
  2. Connect to the robot from the Sample API Client page
  3. Enter a name in the Face Training input box
  4. Put your face up to the camera- foot or two away
  5. Select Start Face Training and wait a few seconds…
  6. Select Stop Face Training
  7. Open a websocket (currently under SLAM buttons)
  8. Select Start Face Recognition
  9. Go in front of the camera
  10. Watch the console for face details to come through

Thanks!

1 Like

Awesome! Thanks @brad!

I used the new API Client and was able to get this to work!

It’s not consistent at this point. I did the process 10 tens and it only worked twice. But that’s a start!

Often the blue light will randomly turn off on the camera, so I’m assuming that’s part of the issue - the connection with the camera is being lost for some reason.

I tried to get this whole process into my own code.

It turns the LED red and then starts the face training. After 10 seconds it stops face training and turns the LED green. Then it starts a websocket, turns the LED blue and starts face recognition. After 20 seconds it stops face recognition and turns LED green.

It goes through the whole process, but I never get any face recognition events. I’ll keep playing around. This is definite progress!

Thanks again!