Methods for Video Face Detection¶
These methods extend general API methods of FindFace Enterprise Server SDK.
In this section:
Method /camera POST¶
Description
Creates a new camera.
Parameters:
meta
[optional]: some user-defined string identifierenabled
[boolean]: enable video processing in FindFace web interfaceurl
[optional]: url address of the camera’s streamdetector
[optional]: some user-defined string identifierrot
[W,H,X,Y] [optional]: enable detecting and tracking faces only inside a clipping rectangle (ROT, region of tracking).roi
[W,H,X,Y] [optional]: enable posting faces detected only inside a region of interest (ROI).
Returns:
A JSON representation of the added camera or a failure reason.
Example
Request
POST /v1/camera/ HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Content-Type: application/json
Content-Length: [length]
{
"meta": "meta",
"enabled": true,
"url": "http://test.com:1234/stream.flv",
"detector": "detec1"
}
Response
HTTP/1.1 201 Created
Content-Length: [length]
Content-Type: application/json; charset=UTF-8
{
"meta": "meta",
"enabled": true,
"url": "http://test.com:1234/stream.flv",
"detector": "detec1",
"id": "7bb35e9d-9f4f-4e5b-8811-e1dded6de811"
}
Method /camera GET¶
Description
Lists all cameras.
Parameters:
This method doesn’t accept any additional parameters.
Returns:
The list of all cameras.
Example
Request
GET /v1/camera HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Response
HTTP/1.1 200 OK
Content-Length: [length]
Date: Thu, 13 Oct 2016 12:14:22 GMT
Content-Type: application/json; charset=UTF-8
[
{
"enabled": true,
"id": "32bc21fb-0aa2-4d17-88bb-1a2bf76d88ea",
"meta": "Camera 1",
"url": "rtsp://127.0.0.1/Streaming/Channels/1"
},
{
"enabled": true,
"id": "32bc21fb-0aa2-4d17-88bb-1a2bf76d88ea",
"meta": "Camera 1",
"roi": [
200,
300,
400,
500
],
"rot": [
100,
100,
800,
800
],
"url": "rtsp://127.0.0.1/Streaming/Channels/1"
}
]
Method /camera/<camera_id> GET¶
Description
Gets information about the camera with id = camera_id
.
Parameters:
This method doesn’t accept any additional parameters.
Returns:
Info about the camera or a failure reason.
Example
Request
GET /v1/camera/32bc21fb-0aa2-4d17-88bb-1a2bf76d88ea HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Response
HTTP/1.1 200 OK
Content-Length: [length]
Content-Type: application/json; charset=UTF-8
{
"enabled": true,
"id": "32bc21fb-0aa2-4d17-88bb-1a2bf76d88ea",
"meta": "Camera 1",
"roi": [
200,
300,
400,
500
],
"rot": [
100,
100,
800,
800
],
"url": "rtsp://127.0.0.1/Streaming/Channels/1"
}
Method /camera/<camera_id> PUT¶
Description
This method can be used to modify certain fields of the camera object with id = camera_id
.
Parameters:
meta
[optional]: new meta stringurl
[optional]: url address of the camera’s streamrot
[W,H,X,Y] [optional]: enable detecting and tracking faces only inside a clipping rectangle (ROT, region of tracking).roi
[W,H,X,Y] [optional]: enable posting faces detected only inside a region of interest (ROI).
Returns:
A JSON representation of the updated camera with id = <camera_id>.
Example #1
Request
PUT /v1/camera/b28a898b-6334-4d37-8888-c9dd858ddc47 HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Content-Type: application/json
Content-Length: [length]
{
"meta": "newinfo",
"url": "http://zzzz.com:1234/stream.flv"
}
Response
HTTP/1.1 200 OK
Content-Length: [length]
Content-Type: application/json; charset=UTF-8
{
"url": "http://zzzz.com:1234/stream.flv",
"id": "b28a898b-6334-4d37-8888-c9dd858ddc47",
"meta": "newinfo"
}
Example #2
Request
PUT /v1/camera/b28a898b-6334-4d37-8888-c9dd858ddc47 HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Content-Type: application/json
Content-Length: [length]
{
"rot": [
120,
120,
35,
50
],
"roi": [
100,
100,
40,
50
]
}
Response
HTTP/1.1 200 OK
Content-Length: [length]
Content-Type: application/json; charset=UTF-8
{
"id": "b28a898b-6334-4d37-8888-c9dd858ddc47",
"rot": [
120,
120,
35,
50
],
"roi": [
100,
100,
40,
50
]
}
Method /camera/<camera_id> DELETE¶
Description
Deletes the camera with id = camera_id
.
Parameters:
This method doesn’t accept any additional parameters.
Returns:
HTTP 204 No Content in the case of success, or the reason of failure.
Example
Request
DELETE /v1/camera/b28a898b-6334-4d37-8888-c9dd858ddc47 HTTP/1.1
Host: 127.0.0.1
Authorization: Token 1234567890qwertyuiop
Content-Length: 0
Response
HTTP 204 No Content