Search database using Base64 | Face Search API | Post Request

Overview

Once you have people’s images registered in your image database, you can identify them by searching your database using Base64 using the FaceSearch: SearchbyBase64 API

This API accepts encoded images which contain only 1 face and the accuracy of the search results will depend on the quality of a person’s registered image and of the image being used to Search.

Image Requirement

Please refer to the article “Image Quality for Facial Recognition” for best practices

Request URL

https://search.facex.io:8443/auth/searchWithEncodedImage

Header

Fields
Type
Description
content-type String application/json

Body (raw)


{"image_encoded": "base64_image"

"user_id" : "your_user_id" }


Note: Your User ID will be valid for this API only if you have an active Face Search plan

Interpreting the Result

When a match is found the API will return the closest three matches. The matches with Euclidian distance less than 0.5 are a match. The Image URL, file name and Registered Name will also be returned to help you display it on your application.

Result

The following response will be sent by the server once the image is registered.

{
    “status”: “ok”,
    “code”: “1000”,
    “success”: true,
    “message”: “Success.”,
    “data”: {
        “user”: [
            {
                “_id”: “image_id_closest match_1”,
                “file_name”: “file_name”,
                “file_directory”: “image_URL”,
                “fullvector”: “vector_value”,
                “user_id”: “”,
                “index_value”: XX,
                “batch_id”: “upload_batch_id”,
                “person_name”: “registered_name”,
                “createdAt”: “time _stamp”,
                “updatedAt”: “time _stamp”,
                “__v”: 0,
                “distance”: 0.1
            },
            {
    “_id”: “image_id_closest match_2”,
                “file_name”: “file_name”,
                “file_directory”: “image_URL”,
                “fullvector”: “vector_value”,
                “user_id”: “”,
                “index_value”: XX,
                “batch_id”: “upload_batch_id”,
                “person_name”: “registered_name”,
                “createdAt”: “time_stamp”,
                “updatedAt”: “time_stamp”,
                “__v”: 0,
                “distance”: 0.6
            },
            },
            {
    “_id”: “image_id_closest match_3”,
                “file_name”: “file_name”,
                “file_directory”: “image_URL”,
                “fullvector”: “vector_value”,
                “user_id”: “”,
                “index_value”: XX,
                “batch_id”: “upload_batch_id”,
                “person_name”: “registered_name”,
                “createdAt”: “time_stamp”,
                “updatedAt”: “time_stamp”,
                “__v”: 0,
                “distance”: 0.61
            },
            }
        ]
    }
}
Related Articles
Post a Comment