The recognize API will detect the faces present in an image and associate labels with them. The return data will contain the Labels and bounding boxes of any faces found. The API returns labels that are generated sequentially, i.e, such as “Person 0”, “Person 1” ..etc. The Face Recognition algorithm associates this generated label with a specific face. Any further images of the same person will get the same label.
/recognize Endpoint URL: https://icof49shn9.execute-api.us-west-2.amazonaws.com/v1/recognize Request Type: POST Header: { "content-type": "application/json", "x-api-key": "<API Key>", "cache-control": "no-cache" } X-api-key: Get your API key from Sentry. Request Body: { "body": { "Site_Id": "string", "Camera_Name": "string", "Image_Bytes": "string" } }
Parameter | Description | Data Type |
Site_Id | Uniquely identifies the site where camera is hosted. You can get this ID from Sentry. | string |
Camera_Name | Name for the camera. | string |
Image_Bytes | Image byte stream in base64 encoded format. | Base64 encoded |
Response:
Here is an example of a successful response, containing the Labels and Bounding Boxes.
200 Response { 'image_id': 'Site-Id_Camera-Name_timestamp', 'Labels': ['Person1', 'Person3'], 'BoundingBoxes': '[[94, 184, 327, 419], [185, 535, 323, 630]]', 'Status Messages': "['OK']" }
The bounding boxes are ordered [top, left, bottom, right] in pixels.
On errors, the “Status Message” field will contain a description