Objects
Add face object
POST /objects/faces/
This method creates new Face object that contains source photo, thumbnail, and other attributes.
Tip
For car or body objects instead faces use cars or body.
The REQUEST BODY is required and contains multipart/form-data with the following parameters:
Name |
Schema |
Description |
|---|---|---|
|
string |
This field can contain one of the following references:
|
|
string |
Auxiliary parameter. |
|
enum |
This parameter defines the FindFace Multi default behaviour when there are multiple objects are present in
|
|
integer |
Add object to this upload list. |
|
binary |
Source photo (required when |
|
integer |
Left border of object’s bounding box. |
|
integer |
Top border of object’s bounding box. |
|
integer |
Right border of object’s bounding box. |
|
integer |
Bottom border of object’s bounding box. |
|
boolean |
|
|
integer |
Related |
Attach the photofile to the source_photo, point out the related card id and paste detection:<detection id> into create_from, where detection id you have got from detection objects on a photo. source_photo must contain the same image that was used for POST /detect.
CURL example
curl -X POST "http://<findface-ip:port>/objects/faces/" \
-H "Accept: application/json" \
-H "Content-Language: ru" \
-H "Accept-Language: ru" \
-H "Authorization: Token <token>" \
-H "Content-Type: multipart/form-data" \
-F "create_from=detection:cf2g86uv54rqhngnq960" \
-F "source_photo=@Смит_01.png" \
-F "card=3" \
If the response is successful (Created: 201), it returns an object that contains the following parameters. Example.
Name |
Schema |
Description |
|---|---|---|
|
string 🆁 |
ID. |
|
date-time 🆁 |
Object creation date. |
|
date-time 🆁 |
Object modification date. |
|
string 🆁 |
Filename supplied for source_photo on object creation. |
|
integer |
Left border of object’s bounding box. |
|
integer |
Top border of object’s bounding box. |
|
integer |
Right border of object’s bounding box. |
|
integer |
Bottom border of object’s bounding box. |
|
uri 🆁 |
Object thumbnail. |
|
boolean |
Default: true. |
|
<any-key>: str┃int┃float┃bool┃object┃array┃null |
Features. |
|
integer |
Related card ID. |
Response example
{
"card": 3,
"created_date": "2023-01-16T08:12:55+00:00",
"modified_date": "1970-01-01T00:00:00+00:00",
"source_photo_name": "Смит_01.png",
"source_photo": "http://172.23.218.94/uploads/cards/7w/3/face_%D0%A1%D0%BC%D0%B8%D1%82_01_ftgY5K.png",
"thumbnail": "http://172.23.218.94/uploads/cards/TD/3/face_%D0%A1%D0%BC%D0%B8%D1%82_01_thumbnail_VyVsIj.png",
"frame_coords_left": 757,
"frame_coords_top": 79,
"frame_coords_right": 948,
"frame_coords_bottom": 353,
"active": true,
"features": {},
"id": "4493225067924944019",
"meta": {}
}
Useful requests
GET /objects/bodies/
POST /objects/bodies/
GET /objects/bodies/{id}/
DELETE /objects/bodies/{id}/
PATCH /objects/bodies/{id}/
GET /objects/cars/
POST /objects/cars/
GET /objects/cars/{id}/
DELETE /objects/cars/{id}/
PATCH /objects/cars/{id}/
GET /objects/faces/
POST /objects/faces/
GET /objects/faces/{id}/
DELETE /objects/faces/{id}/
PATCH /objects/faces/{id}/


