Multi-Object API Methods v3
In this section:
Detect Methods
Detect Objects on the Photo
POST /v3/detect
This method detects an object in a provided image and returns coordinates of the rectangle around the object (a.k.a. bbox) and the object orientation.
Note
Object detection is done by the extraction-api
component, so the sf-api
component formats your initial request and forwards it to extraction-api
.
Query string parameters:
detector
: string, object detector to be applied to the image (see objects in theextraction-api
configuration file).cache
: boolean, if true, the formatted request toextraction-api
will include such feature vectors asface_emben
,body_emben
,car_emben
andneed_normalized
(obtain a normalized object image). The objects inextraction-api
response will be saved inmemcached
under a ID. You can find this ID in theid
field of the response. If not specified, thesf-api
response will not contain feature vectors.autorotate
: boolean, auto-rotates an original image to 4 different orientations and returns objects detected in each orientation.roi
: string, a region of interest in the image, takes an array of integers in the format roi=top,left,right,bottom, (e.g. {“left”: 0, “right”: 1000, “top”: 0, “bottom”: 1000}).return_emben
: boolean, returns a object feature vector in the response. Requires the enabledallow-return-facen
flag in thesf-api
configuration file. Requires the corresponding object in thesf-api
configuration file in theobjects
section.quality_estimator
: boolean, enables object quality estimation.attribute
: array of strings in the formatface_gender
,face_age
,face_emotions
,face_beard
,face_glasses3
, enables recognition of the object features passed in the array.
Tip
To enable a boolean parameter (cache
, etc.), use any of the following strings: 1
, yes
, true
, or on
, in any letter case.
Parameters in request body:
Image as a file of the image/jpeg
, image/png
, or image/webp
MIME-type, or as a text/x-url
link to a relevant public URL.
Returns:
Returns a temporary object that can be stored in the cashe memcache
, redis
, or sf-api
memory. It contains:
temporary ID of the detection result (
id
, ifcache
enabled);Important
When you form a request, be sure to check the relevance of the temporary ID before you refer to it as it tends to become irrelevant with time. If so, re-detect the object.
bbox
: list of coordinates of the rectangles around the detected objects;score
: algorithm confidence in the result.attributes
(if passed): feature vector (ifreturn_emben
enabled) and attributes specified in the request parameters with extractor, model and result:age (if
face_age
passed): number of years;emotions (if
face_emotions
passed): 6 basic emotions + neutral (angry
,disgust
,fear
,happy
,sad
,surprise
,neutral
) with algorithm confidence in each emotion expression;gender (if
face_gender
passed):male
orfemale
, with model and algorithm confidence in the result ("confidence"
);other attributes (if passed): beard (
beard
), glasses (sun
,eye
, ornone
), along with algorithm confidence in the result;
orientation
: EXIF orientation of the photo.
Examples
Request
curl -i -X POST 'http://127.0.0.1:18411/v3/detect?cache=on&attribute=face_gender&attribute=face_age&attribute=face_emotions&attribute=face_glasses3' -H 'Content-Type: image/jpeg' --data-binary @sample.jpg
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:BpLnfgDs
Date: Thu, 23 May 2019 12:00:22 GMT
Content-Length: 713
{
"objects": {
"face": [
{
"id": "bjj8mlhjisgjrk6hj1v0",
"bbox": {"left": 595, "top": 127, "right": 812, "bottom": 344},
"score": 0.9171224,
"attributes": {
"face_age": {"extractor": "face_age", "model": "age.v1", "result": 24},
"face_emotions": {
"extractor": "face_emotions",
"model": "emotions.v1",
"result": [
{"confidence": 0.9998919, "name": "neutral"},
{"confidence": 9.195882e-05, "name": "sad"},
{"confidence": 1.4304824e-05, "name": "happy"},
{"confidence": 1.8077538e-06, "name": "surprise"},
{"confidence": 4.2787672e-08, "name": "angry"},
{"confidence": 2.0801991e-08, "name": "disgust"},
{"confidence": 1.9873138e-11, "name": "fear"}
]
},
"face_gender": {
"extractor": "face_gender",
"model": "gender.v2",
"result": [
{"confidence": 0.9999119, "name": "female"},
{"confidence": 8.809325e-05, "name": "male"}
]
},
"face_glasses3": {
"attribute": "face_glasses3",
"model": "glasses3.v0",
"result": [
{"confidence": 0.99958307, "name": "none"},
{"confidence": 0.00033243417, "name": "eye"},
{"confidence": 8.4465064e-05, "name": "sun"}
]
}
}
}
]
},
"orientation": 1
}
Get Detection Result from the Cache by ID
GET /v3/detect/:id
This method retrieves the detection results from the cache by their temporary ID (including feature vectors of the detected objects).
Parameters in path segments:
:id
: string, the detection result temporary ID in the cache.
Returns:
JSON representation of the detection result.
Example
Request
curl -i -X GET 'http://127.0.0.1:18411/v3/detect/bg2gu31jisghl6pee09g'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:HlQBSnTu
Date: Wed, 05 Dec 2018 07:51:04 GMT
Content-Length: 477
{
"face": {
"id": "bjj8mlhjisgjrk6hj1v0",
"bbox": {"left": 595, "top": 127, "right": 812, "bottom": 344},
"score": 0.9171224,
"attributes": {
"face_age": {"extractor": "face_age", "model": "age.v1", "result": 24},
"face_emotions": {
"extractor": "face_emotions",
"model": "emotions.v1",
"result": [
{"confidence": 0.9998919, "name": "neutral"},
{"confidence": 9.195882e-05, "name": "sad"},
{"confidence": 1.4304824e-05, "name": "happy"},
{"confidence": 1.8077538e-06, "name": "surprise"},
{"confidence": 4.2787672e-08, "name": "angry"},
{"confidence": 2.0801991e-08, "name": "disgust"},
{"confidence": 1.9873138e-11, "name": "fear"}
]
},
"face_gender": {
"extractor": "face_gender",
"model": "gender.v2",
"result": [
{"confidence": 0.9999119, "name": "female"},
{"confidence": 8.809325e-05, "name": "male"}
]
},
"face_glasses3": {
"attribute": "face_glasses3",
"model": "glasses3.v0",
"result": [
{"confidence": 0.99958307, "name": "none"},
{"confidence": 0.00033243417, "name": "eye"},
{"confidence": 8.4465064e-05, "name": "sun"}
]
}
}
}
}
Create Detection Result out of extraction-api
Response
POST /v3/detect/premade
This method creates a detection result out of a extraction-api
response. Requires allow-return-facen: true
in sf-api
configuration file.
Parameters in path segments:
The method doesn’t accept any parameters.
Parameters in request body:
Request body contains the object in a format similar to the response GET /v3/detect/:id: { "object type": object from the extraction-api response }
Returns:
JSON with "id"
on success.
Example
Request
curl -i -X POST 'http://127.0.0.1:18411/v3/detect/premade' -H 'Content-Type: application/json' --data-binary '@extapi-face.json'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:jFSBuSPm
Date: Wed, 05 Dec 2018 08:08:56 GMT
Content-Length: 2
{"id": "bg2gu31jisghl6peea9g"}
Get Normalized Detect by ID
GET /v3/detect/:id/normalized
This method retrieves normalized detect by ID.
Parameters in path segments:
:id
: ID.
Returns:
Normalized object images on success.
Example
Request
curl -i 'http://127.0.0.1:18411/v3/detect/bg2gu31jisghl6pee09g/normalized'
Response:
HTTP/1.1 200 OK
Content-Type: image/png
X-Request-Id: SF:mjv3Lyvf
Date: Thu, 09 Apr 2020 15:59:48 GMT
Transfer-Encoding: chunked
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
Compare Two Objects
GET /v3/verify
This method compares a pair of objects (faces, bodies) and returns a probability of their belonging to the same person (a.k.a. similarity, or confidence).
Query string parameters:
"obj1"
: the first object, either a detection result (ID of the result from thePOST /v3/detect
method), or one from the biometric database (in the formatpersistent:<objtype>/<gallery>/<id>
oremben:[model:]<base64 emben>
ifallow-return-facen:true
)."obj2"
: the second object, from the same possible sources as the first object.
Returns:
Algorithm confidence that the objects match.
Example
Request #1. Compare 2 detection results
curl -s 'http://127.0.0.1:18411/v3/verify?obj1=detection%3Acp1nh3k8kuic72tu0ljg%22&obj2=detection%3Acp1nh3k8kuic72tu0ljg%22' | jq
Response
{
"confidence": 0.92764723
}
Request #2. Compare a detection result and a face from a gallery
curl -i 'http://127.0.0.1:18411/v3/verify?obj1=detection:bg2gu31jisghl6pee09g&obj2=persistent:face/history/4141715733352439863' | jq
Response
{
"confidence": 0.999996
}
Gallery Methods
List Database Galleries
GET /v3/galleries/
This method returns the list of all galleries in the biometric database.
Parameters:
The method doesn’t accept any parameters.
Returns:
JSON dictionary with the list of gallery names.
Example
Request
curl -i -X GET 'http://127.0.0.1:18411/v3/galleries/'
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:BjI7i3GZ
Date: Wed, 05 Dec 2018 08:19:55 GMT
Content-Length: 125
{
"galleries": {
"face": [
{ "objects": 22, "name": "history" },
{ "objects": 1, "name": "test" },
{ "objects": 0, "name": "hello" }
],
"car": [
{ "objects": 11, "name": "test" }
],
"body": [
{ "objects": 51, "name": "entrance" }
]
}
}
Create a Gallery
POST /v3/galleries/:objtype/:gallery
This method creates a gallery under a given name.
Parameters in path segments:
:objtype
: string, an object type.:gallery
: string, a new gallery’s name. It can contain English letters, numbers, underscore and minus sign ([a-zA-Z0-9_-]+
) and must be no longer than 48 characters.space
: name of the space in the tarantool, passed in the body. Optional parameter.live_idx
: parameters for Live index in the tarantool, passed to the body. Optional parameter.
Returns:
Empty JSON on success.
JSON with a relevant error description on failure.
Example
Request
curl -i -X POST 'http://127.0.0.1:18411/v3/galleries/face/hello' -d '{"space":"some_space_name"}'
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:whPaBcoV
Date: Wed, 05 Dec 2018 08:16:20 GMT
Content-Length: 2
{}
If the gallery already exists, 409 will be returned.
Request
curl -i -X POST 'http://127.0.0.1:18411/v3/galleries/face/hello'
Response
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: SF:9S0gvzfM
Date: Wed, 05 Dec 2018 08:15:00 GMT
Content-Length: 62
{ "code": "CONFLICT", "desc": "Gallery \"hello\" already exists" }
Retrieve Gallery Details
GET /v3/galleries/:objtype/:gallery
This method checks the existence of the gallery and request the number of objects in it.
Parameters in path segments:
:objtype
: string, an object type.:gallery
: string, a gallery’s name.
Returns:
JSON dictionary with the number of objects and gallery name on success.
JSON with a relevant error description on failure.
Example
Request
curl -i -X GET 'http://127.0.0.1:18411/v3/galleries/face/hello'
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:Ard3exjn
Date: Wed, 05 Dec 2018 08:17:54 GMT
Content-Length: 29
{"name":"ffsec_face_events","emben_model":"kiwi_320","emben_size":320,"objects":474}
Delete Gallery
DELETE /v3/galleries/:objtype/:gallery
This method deletes the gallery and all the objects in it.
Parameters in path segments:
:objtype
: string, the name of the object to be deleted.:gallery
: string, the name of the gallery to be deleted.
Returns:
Empty JSON dictionary on success.
JSON with a relevant error description on failure (404 if the gallery didn’t exist).
Example
Request
curl -i -X DELETE 'http://127.0.0.1:18411/v3/galleries/face/hello'
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:oJh9FEtX
Date: Wed, 05 Dec 2018 08:15:04 GMT
Content-Length: 2
{}
Rename the Gallery
PATCH /v3/galleries/:objtype/:gallery
This method renames the gallery.
Parameters in path segments:
:objtype
: string, the name of the object to be renamed.:gallery
: string, the name of the gallery to be renamed.
Parameters in request body:
name
: string, new name of the gallery.
Returns:
Empty JSON dictionary on success.
JSON with a relevant error description on failure (409 if the target name is already occupied).
Example
Request
curl -i -X PATCH -d '{"name": "testgal2"}' -H "Content-Type: application/json" http://127.0.0.1:18411/v3/galleries/face/testgal1
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:AAwdCxmM
Date: Tue, 04 Feb 2020 08:10:15 GMT
Content-Length: 2
{}
List of galleries of a specific type
GET /v3/galleries/:objtype
Parameters in path segments:
:objtype
: string, the name of the object.
Returns:
JSON dictionary of list of galleries of a specific type on success.
JSON with a relevant error description on failure.
Example
Request
curl -i -X GET 'http://127.0.0.1:18411/v3/galleries/face/'
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:BjI7i3GZ
Date: Wed, 05 Dec 2018 08:19:55 GMT
Content-Length: 125
{
"galleries": [
{ "objects": 22, "name": "history" },
{ "objects": 1, "name": "test" },
{ "objects": 0, "name": "hello" }
]
}
Methods with Objects in the Gallery
Create an Object to Database
POST /v3/galleries/:objtype/:gallery/objects/:id
This method takes a detected object from the cache or an object from a gallery. It then adds the object with its feature vector to a given gallery under a custom id. The custom id and destination gallery are to be specified in the path segments. Along with the object, you can also add metadata which uniquely describes the person, for example, the person’s name.
Parameters in path segments:
:objtype
: string, the name of the object.:gallery
: string, the name of the gallery to add the object in.:id
: integer, permanent object id in the gallery, uint64.
Parameters in request body:
from
: identifier of the object serving as a source for the one being created:detection:<id>
– result of the detection.persistent:<objtype>/<gallery>/<id>
– existing object in the gallery.inline-detection
– detection object attached to the request in the field detection. Available only whenallow-return-facen
is enabled. If the detector is not specified normalized, such an object cannot be migrated to a new model.emben:[model:]<base64 emben>
– emben (with or without model) in base64. Available only whenallow-return-facen
is enabled. Creates incomplete objects that cannot be migrated between models.
meta
[optional]: dictionary of meta-fields.detection
: detection object similar to the one passed inPOST /v3/detect/premade
(only the object itself, without wrapping in{"object type": ...}
, because the type is already known).
Returns:
JSON representation of the added object on success. If the query-argument
return_emben
is passed andallow-return-facen
is enabled in the configuration file, it will also return emben in the response field. If the query-argumentreturn_full_meta
is passed, it will return the full meta, including fields filled in from defaults.Error on failure.
Example
Request
curl -i -X POST http://127.0.0.1:18411/v3/galleries/face/hello/objects/123/ -H 'Content-Type: application/json' --data-binary '@-' <<EOF
{
"from": "detection:bg2gu31jisghl6pee09g",
"meta": {
"camera": "openspace",
"labels": ["foo", "bar"],
"timestamp": "1543837276"
}
}
EOF
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:OSSKbJg3
Date: Wed, 05 Dec 2018 08:27:59 GMT
Content-Length: 555
{
"id": { "type":"face", "object": 123, "gallery": "hello" },
"meta": {
"camera": "openspace",
"labels": ["foo", "bar"],
"timestamp": "1543837276"
},
}
Get an Object by ID
GET /v3/galleries/:objtype/:gallery/objects/:id
This method retrieves an object from a database gallery by id.
Parameters in path segments:
:objtype
: string, the name of the object.:gallery
: string, the name of the gallery to retrieve an object from.:id
: an object id in the gallery, uint64.
Returns:
JSON representation of the retrieved object on success. If the query-argument
return_emben
is passed andallow-return-facen
is enabled in the configuration file, it will also return emben in the response field.Error on failure.
Example
Request
curl -i -X GET http://127.0.0.1:18411/v3/galleries/face/hello/objects/123/
Response
See the response format in the POST description.
Delete an Object from Gallery
DELETE /v3/galleries/:objtype/:gallery/objects/:id
This method deletes an object from a database gallery by id.
Parameters in path segments:
:objtype
: string, the name of the object to delete.:gallery
: string, the name of the gallery to delete the object from.:id
: object id in the gallery, uint64.
Returns:
Empty JSON on success.
Error on failure.
Example
Request
curl -i -X DELETE http://127.0.0.1:18411/v3/galleries/face/hello/objects/123/
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:9s1oFbFP
Date: Wed, 05 Dec 2018 08:32:14 GMT
Content-Length: 2
{}
Update Object Metadata in Gallery
PATCH /v3/galleries/:objtype/:gallery/objects/:id
The method updates an object metadata in a database gallery by id.
Parameters in path segments:
:objtype
: string, the name of the object.:gallery
: string, the gallery’s name.:id
: object id in the gallery, uint64.
Parameters in request body:
Important
If the field is not mentioned in the query, its value is not changed. Values of all field types are replaced in their entirety, even if the value is composite.
from
: identifier of the object serving as a source for the one being created:meta
: dictionary with the face’s new metastrings.detection
: detection object.
Returns:
JSON representation of the updated face on success. If the query-argument
return_emben
is passed andallow-return-facen
is enabled in configuration file, it also returns emben in the response field. If the from field is passed, it will overwrite emben and (if there is one in the source) normalized object image.Error on failure.
Example
Request
curl -i -X PATCH http://127.0.0.1:18411/v3/galleries/face/hello/objects/123/ -H 'Content-Type: application/json' --data-binary '@-' <<EOF
{
"meta": {
"labels": ["foo", "bar"]
}
}
EOF
Response
See response format in description of object creation.
Get a List of Objects in the Gallery
GET /v3/galleries/:objtype/:gallery/objects/
This method allows you to search objects in a gallery by using filters specified in the query string.
Parameters in path segments:
:gallery
: the name of the gallery to search in.
Query string parameters:
limit
: maximum number of objects in the response. * Required parameter.sort
: sorting order. Pass one of the following values:id
: increasing order by id,-id
: decreasing order by id,-confidence
: sorting by ascending and descending id, descending confidence (only if a similarity filter is set).page
: cursor of the next page with search results. The<page>
value is returned in the response in thenext_page
parameter along with the previous page results (see details below).ignore_errors
: By default, if one or severaltntapi
shards are out of service during object identification,sf-api
returns an error. Enable this Boolean parameter to use availabletntapi
shards to obtain object identification results.return_emben
: ifallow_return_facen
is enabled in config, return emben for each object in response.
Filters in query string parameters:
meta:in:meta1=val1&meta:in:meta1=val2&...
: select an objects if a meta stringmeta1
is equal to one of the valuesval1
/val2
/ …, etc. (uint64, string).meta:gte:meta1=val1
: select all objects with a meta stringmeta1
greater or equal toval1
(uint64).meta:lte:meta1=val1
: select all objects with a meta stringmeta1
less or equal toval1
(uint64).meta:subset:meta1=val1&meta:subset:meta1=val2&...
: select an object if a meta stringmeta_field
contains all the valuesval1
,val2
, …, etc. ([]string).id:in=value_id
: select all objects withid
equal tovalue_id
.id:gte=value_id
: select all objects withid
greater or equal tovalue_id
.id:lte=value_id
: select all objects with id less or equal tovalue_id
.looks_like=0.75=detection:bg2gu31jisghl6pee09g
: select if object is similar to detectionbg2gu31jisghl6pee09g
with confidence not lower than 0.75.looks_like=0.78=persistent:face/hello/123
: select if the object looks like face123
from galleryhello
with a confidences not lower than 0.78.looks_like=0.81=emben:[model:]<base64 emben>
: select if the object is similar to the passed feature vector with a confidences not lower than 0.81. Available only ifallow-return-facen
is enabled.meta:like:meta1=val1%
: ~sql like: any combination of characters and % sign is supported, e.g. ‘aa%’, ‘%aa’, ‘%aa%’ or even ‘%aa%bb%’. That is, ‘%’ is treated as ‘any number of any characters’. For data typearray/list
- if any of the values passed the check. Always properly escape%
.meta:ilike:meta1=Val1%
: case-insensitive analogue ofmeta:like
filter.
Do not forget that emben is encoded base64.StdEncoding
and may contain characters =
. Always properly escape your emben.
You can only set one similarity filter in one query (several are BAD_PARAM). If you set looks_like
, the default sort will automatically switch to -confidence.
Returns:
JSON representation of an array with found objects.
The response format is the following:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: [...]
{
"objects": [
{
... object 1 data ...
"confidence": 0.123 // if a similarity filter was specified
},
{
... object 2 data ...
"confidence": 0.123 // if a similarity filter was specified
},
...
],
"next_page": "vgszk2bkexbl" // next page cursor
}
The next_page
parameter is a URL-safe string that you will have to pass in the ?page=
in the next request in order to get the next page of results. Pagination is available only if the filtration by feature vector is disabled.
Example
Request #1.
curl -i -X GET http://127.0.0.1:18411/v3/galleries/face/history/objects/?limit=5&meta:in:camera=openspace&meta:in:camera=entrance&meta:lte:timestamp=1543845934&meta:gte:timestamp=1514801655&looks_like=0.4=detection:bg2gu31jisghl6pee09g
Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: SF:ibKVYpcb
Date: Wed, 05 Dec 2018 08:37:33 GMT
Transfer-Encoding: chunked
{
"objects": [
{
"confidence": 0.6026,
"id": { "type":"face", "object": 4141715030051545133, "gallery": "history" },
"meta": {
"bbox": "[607, 802, 738, 933]",
"camera": "openspace",
"is_friend": 0,
"labels": [],
"score": 9999999999998079040,
"timestamp": 1542909082
}
},
{
"confidence": 0.5325,
"id": { "type":"face", "object": 4141715086422990894, "gallery": "history" },
"meta": {
"bbox": "[741, 905, 953, 1117]",
"camera": "openspace",
"is_friend": 0,
"labels": [],
"score": 9999999999993877300,
"timestamp": 1542909103
}
},
{
"confidence": 0.531,
"id": { "type":"face", "object": 4141716493024780347, "gallery": "history" },
"meta": {
"bbox": "[90, 869, 166, 945]",
"camera": "openspace",
"is_friend": 0,
"labels": [],
"score": 10000000000000000013,
"timestamp": 1542909627
}
},
{
"confidence": 0.5236,
"id": { "type":"face", "object": 4141716498393489468, "gallery": "history" },
"meta": {
"bbox": "[56, 853, 125, 923]",
"camera": "openspace",
"is_friend": 0,
"labels": [],
"score": 9999999999999999053,
"timestamp": 1542909629
}
},
{
"confidence": 0.5212,
"id": { "type":"face", "object": 4141715338752319538, "gallery": "history" },
"meta": {
"bbox": "[-36, 862, 60, 958]",
"camera": "openspace",
"is_friend": 0,
"labels": [],
"score": 9999999999999999425,
"timestamp": 1542909197
}
}
],
"next_page": "There are more than 5 results, but pagination is not supported when filtering by emben"
}
Request #2.
curl -s -X GET http://127.0.0.1:18411/v3/galleries/face/hello/objects/\?limit\=1\&meta:like:camera\=%25pace\&meta:ilike:labels\=FO%25
Response
{
"objects": [
{
"id": {
"type": "face",
"gallery": "hello",
"object": 123
},
"meta": {
"camera": "openspace",
"labels": [
"foo",
"bar"
],
}
}
]
}
Get a Normalized Objects Image from the Gallery
GET /v3/galleries/:objtype/:gallery/objects/:id/normalized
Parameters in path segments:
:objtype
: string, the name of the object.:gallery
: string, the gallery’s name.:id
: object id in the gallery, uint64.
Returns:
Returns Header location
and text/plain
with a link to the normalized photo (storage link from normalized-storage
config).
Successful response is available only if normalized-storage.enabled
is enabled in config.
Example
Request
curl -vvv http://localhost:18411/v3/galleries/face/hello/objects/1234/normalized
Response
HTTP/1.1 302 Found
Content-Type: text/plain
Location: http://127.0.0.1:3333/uploads/ZmFjZTpoZWxsbw==/6c/df/1234_cf7umjq92d3l006ou0rg.png
X-Request-Id: SF:Edz0ThbX
Date: Tue, 24 Jan 2023 14:37:39 GMT
Content-Length: 87
http://127.0.0.1:3333/uploads/ZmFjZTpoZWxsbw==/6c/df/1234_cf7umjq92d3l006ou0rg.png
Get Models Information
GET /v3/models-info
Parameters in path segments::
The method doesn’t accept any parameters.
Returns:
Returns information about available (i.e. enabled) detectors, normalizers, extractors and objects in extraction-api
.
Example
Request
curl -s http://localhost:18411/v3/models-info | jq
Response
{
"detectors": {
"body": {
"object_types": [
"body"
]
},
"car": {
"object_types": [
"car"
]
},
"gustav_body": {
"object_types": [
"body"
]
},
"gustav_car": {
"object_types": [
"car"
]
},
"headbodyface": {
"object_types": [
"head",
"body",
"face"
]
},
"license_plate": {
"object_types": [
"license_plate"
]
},
"license_plate_gustav_accurate": {
"object_types": [
"license_plate"
]
},
"shiloette": {
"object_types": [
"body"
]
}
},
"normalizers": {
"carlicplate": {
"normalization_type": "carlicplate"
},
"cropbbox": {
"normalization_type": "cropbbox"
},
"norm200": {
"normalization_type": "norm200"
}
},
"extractors": {
"car_color": {
"normalization": "crop1x",
"model_name": "carattr_color.v0"
},
"car_quality": {
"normalization": "cropbbox",
"model_name": "carattr.quality.v0"
},
"face_emben": {
"normalization": "norm200",
"model_name": "kiwi_160"
},
"face_quality": {
"normalization": "crop1x",
"model_name": "quality_fast.v1"
},
"license_plate_quality": {
"normalization": "cropbbox",
"model_name": "carlicplateattr.quality.v0"
}
},
"objects": {
"car": {
"quality_attribute": "car_quality",
"base_normalizer": "cropbbox"
},
"face": {
"quality_attribute": "face_quality",
"base_normalizer": "crop2x"
},
"license_plate": {
"quality_attribute": "license_plate_quality",
"base_normalizer": "carlicplate"
}
}
}