Azure-Samples / azure-ai-vision-sdk

SDK for Microsoft's Azure AI Vision
MIT License
80 stars 50 forks source link

Liveness verify with face ID #110

Closed Bestfastfire closed 1 month ago

Bestfastfire commented 1 month ago

Is it possible to do liveness verify by comparing with a faceID that exists? I saw the example comparing it with an image directly, but I would like to compare it with a faceId.

Another thing, during liveness it is possible to obtain this field:

// kotlin
    protected var analyzedListener =
        EventListener<FaceAnalyzedEventArgs> { _, e ->
            e.result.use { result ->
                if (result.faces.isNotEmpty()) {
                    val face = result.faces.iterator().next()
                    val faceUid = face.faceUuid.toString()
...

I tried using faceUID to purchase through the endpoint:

{endpoint}/face/v1.2-preview.1/verify

Body:

{
  "faceId1": "id1...",
  "faceId2": "id2..."
}

But he always tells me that the face was not found:

{
    "error": {
        "code": "FaceNotFound",
        "message": "Face is not found."
    }
}