Search database using Image File | 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 an Image file using the FaceSearch: SearchbyRawImage API

This API accepts image files 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

  1. Please refer to the article “Image Quality for Facial Recognition” for best practices.
  2. We recommend an image resolution no higher than 1024x, since it could slow down the request process. Supported image formats are JPEG/PNG format.

Request URL

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

Header

Fields
Type
Description
content-type String multipart/form-data

Body

Fields

Type

Description

image file An image file, supported files jpeg, png
user_id String Your valid User ID

(as shown in your user portal when you log in)

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