05.4.18

Introducing Facebox Faceprint

Since releasing Facebox, people have started to come up with some very interesting use cases. For example, partners like Pixitmedia have integrated Facebox into their storage platform so that customers can search and access all of their assets quickly.

Another use case involves using face-verify.js to increase the security of any website by validating who is looking at the site with the webcam.

Faceprint works very similar to a fingerprint

What is Faceprint?

Similar to fingerprints, Faceprint is a way to get a unique identifier of a face. With Facebox, you can now get the Faceprint of a face by making the following http request:

POST https://localhost:8080/facebox/check
{
  "url": "https://machinebox.io/samples/faces/thebeatles.jpg",
  "faceprint": true
}

The response would include not only the faces, and the people that it recognizes, but also all of the Faceprints.

A Faceprint will look like a big string (around 1000 characters)

{
  "success": true,
  "facesCount": 12,
  "faces": [
  {
    "rect": {
      "top": 124,
      "left": 636,
      "width": 52,
      "height": 52
    },
    "matched": false,
    "confidence": 0,
    "faceprint": "DP+BAgEC/4IAAQgAAP4C+f+CAP+A+0CU7rS//..."
  },
  ... 
  ]
}

What can you do with a Faceprint?

You can store the Faceprint in your database or in your search engine so you don’t have to reprocess all the photos or videos against Facebox to recognize new people in all of your content. Instead, you can use the Faceprints, which will make each request really really fast.

Teach and Check using the Faceprint

Instead of a photo or a frame of video, you can teach Facebox using the Faceprint. For example, we can tag a previously returned unknown Faceprint as John Lennon:

POST /facebox/teach
{
  "id": "j1", 
  "name": "John Lennon",
  "faceprint": "DP+BAgEC/4IAAQgAAP4C+f+CAP+A+0CU7rS//..."
}
Response: {"success": true}

Or, you can use the /facebox/faceprint/checkendpoint to check a Faceprint to see who it belongs to:

POST /facebox/faceprint/check
{
  "faceprints": ["DP+BAgEC/4IAAQgAAP4C+f+CAP+A+0CU7rS//..."]
}

Response:

{ 
  "success": true, 
  "faceprints": [ 
    { 
      "id": "j1",
      "name": "John Lennon", 
      "matched": true,
      "confidence": 0.982
    }
  ] 
}

You can teach Facebox new people, then retroactively apply that to all of your media by simply running a check of Faceprints in your database against the newly taught Facebox. This process is MUCH quicker than re-sending photos or video to a facial recognition system!

Compare multiple Faceprints to another Faceprint

Let’s say that you are processing video (you can process video with Videobox) and you want to group the faces of the people that appear on the video.

You probably are processing the video frame by frame (or one frame per X seconds), so all you need to do is accumulate all the Faceprints that you find in the video in memory, and use the following request to check if a new Faceprint target is from any of the people that we’ve seen before.

POST /facebox/faceprint/compare
{
  "faceprints": [
    "F/+DAgEBCVtdZmxvAABCAAA...", 
    "4D7IEUvv7/7QMIIkj/7wGMC...", 
    "tg+CS1P/uAx4N+P/dddsegg..."
  ],
  "target": "J/+ZDRTEBCVtdZmxY..."
}

Response:

{
  "success": true,
  "confidences": [
    0.21287301029665473, 
    0.7309214023621301,
    0.820001
  ]   
}

If the confidence is high (maybe greater than 0.5 is a good start to do a good grouping on a video), it means the Faceprint belongs to the same person.

With this request you can easily start grouping people (whether known or unknown) across all of your assets, with very little overhead.

Privacy considerations

Faceprint can be considered biometric data, the same type of data as your fingerprint when it’s stored on your phone. Before storing the Faceprint, please check the regulations in your country for storing biometric data. For example, in Europe with the GDPR you need consent of the user to be able to store that kind of data.

Use Faceprint right now!

Pull the latest version of Facebox today. Faceprint is available for STARTUP and PRO costumers.

# update your facebox to use Faceprint
$ docker pull machienbox/facebox