How to Use Multi-Object API
In this section:
Endpoint
Multi-Object API requests are to be sent to http://<sf-api_IP_address>:18411/
. API requests are executed by the sf-api
component.
API Version
The API version is increased every time a major change is made and allows us to avoid breaking backwards compatibility. The API version is to be specified in the request path (for example, v3 in /v3/detect/
).
There are versions v2 and v3 at the moment. The most recent version is v3.
Tip
When starting a new project, always use the latest stable API version.
API Objects
Multi-Object API operates the multiple objects that represent detected physical objects. The most basic are:
face
– a human facebody
– a human silhouettecar
– a vehicle
Note
There can be several objects in a photo and thus several API objects associated with it.
Note
Different images of the same object are considered to be different API objects.
Parameters Format
There are two ways to pass a photo image to the system:
as a publicly accessible URL,
as a file.
There are three ways to pass parameters to the multi-object API:
image/jpeg, image/png, image/webp, image/bmp: to pass a photo image as a file,
text/x-url: to pass a photo image as an URL,
query string: parameters appended to a URI request.
All responses are in JSON format and UTF-8 encoding.
How to Use Examples
Examples in methods descriptions illustrate possible method requests and responses. To check the examples without writing code, use the
embedded API framework. To access the framework, enter in the address bar of your browser: http://<sf-api_IP_address>:18411/docs/
for the API version /v3.
Limits
FindFace Server imposes the following limits.
Limit |
Value |
---|---|
Image formats |
JPG, PNG, WEBP, BMP |
Maximum photo file size |
To be configured via the |
Minimal size of an object |
50x50 pixels |
Maximum number of detected objects per photo |
Unlimited |
Important
Additionally, the URL provided to the API to fetch an image must be public (without authentication) and direct (without any redirects).
Error Reporting
If a method fails, it always returns a response with a HTTP code other than 200, and a JSON body containing the error description. The error body always includes at least two fields: code
and desc
.
code
is a short string inCAPS_AND_UNDERSCORES
, usable for automatic decoding.desc
is a human-readable description of the error and should not be interpreted automatically.
Common Error Codes
Error code |
Description |
HTTP code |
---|---|---|
|
Error with unknown origin. |
500 |
|
The request can be read, however, some method parameters are invalid. This response type
contains additional attributes |
400 |
|
Conflict. |
409 |
|
Error upon an object feature vector extraction. |
503 |
|
The system configuration does not match license. |
503 |
|
The request is malformed and cannot be read. |
400 |
|
The |
429 |
|
The face in the |
400 |
|
The gallery in the |
400 |
|
The multi-object database not available. |
503 |
|
Memcached not available. |
503 |
|
Matching objects not found. |
404 |
|
This functionality not implemented. |
501 |
|
Matching galleries not found. |
404 |