Face Match

The face match api compares faces in two different pictures and tells the similarity between them. A typical use of this is matching identity documents with pictures of a person. In this tutorial

Example

Here we shall compare two pictures of Obama

const request = require("request")
const fs = require("fs")
image_stream1 = fs.createReadStream("test-image6.jpeg")
image_stream2 = fs.createReadStream("test-image7.jpg")
var form = {"image1":image_stream1,"image2":image_stream2}
request.post({url:"http://localhost:80/v1/vision/face/match", formData:form},function(err,res,body){
response = JSON.parse(body)
console.log(response)
})

Response

{ success: true, similarity: 0.73975885 }

Example 2

Here we shall compare a picture of Obama with that of Bradley Cooper

const request = require("request")
const fs = require("fs")
image_stream1 = fs.createReadStream("test-image6.jpeg")
image_stream2 = fs.createReadStream("test-image8.jpg")
var form = {"image1":image_stream1,"image2":image_stream2}
request.post({url:"http://localhost:80/v1/vision/face/match", formData:form},function(err,res,body){
response = JSON.parse(body)
console.log(response)
})

Response

{ success: true, similarity: 0.4456826 }

As seen above, the match for two different pictures of Obama was very high while the match for Obama and Bradley Cooper was very low.

Performance

DeepStack offers three modes allowing you to tradeoff speed for peformance. During startup, you can specify performance mode to be , “High” , “Medium” and “Low”

The default mode is “Medium”

You can specify a different mode during startup as seen below as seen below

CPU Version
GPU Version
sudo docker run -e MODE=High VISION-FACE=True -v localstorage:/datastore -p 80:5000 \
deepquestai/deepstack
sudo docker run --rm --runtime=nvidia -e MODE=High -e VISION-FACE=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack:gpu

Note the -e MODE=High above

On Windows, you can easily select the High mode in the UI

Note the High radio button selected above