Counting API
get
https://counting.traces.cloud/
api/v1/health
health
curl -X GET "http://faf.traces.cloud.api/v1/health" -H "accept: */*"
For a successful usage of Traces Counting API, it is required to do the following step:
- Register a camera by providing coordinates of counting triangles. It should be done only once for every unique camera. Read more about counting triangles here.
If the placement of a camera or areas of interest has changed, just update the coordinates of counting triangles by sending a new POST request with the same 'camera id'.
post
https://counting.traces.cloud/
api/v1/object-counting-settings
object-counting-settings
data.json
{
"camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e",
"counting_triangles": [
{
"passway_name": "2nd-floor-escalator-up",
"coordinates": {
"x1": 0,
"y1": 0,
"x2": 100,
"y2": 100,
"x3": 50,
"y3": 50
}
},
{
"passway_name": "2nd-floor-escalator-down",
"coordinates": {
"x1": 200,
"y1": 200,
"x2": 400,
"y2": 400,
"x3": 350,
"y3": 350
}
}
]
}
cURL
cURL
curl -X POST -H "Content-Type: application/json" -H "X-Traces-API-Key: YOUR_API_KEY" -d @data.json https://counting.traces.cloud/api/v1/object-counting-settings
curl -X POST "https://counting.traces.cloud/api/v1/object-counting-settings" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"camera_id\":\"b5271b30-aecd-4897-bc95-ff25c8466b9e\",\"passways\":[{\"passway_name\":\"2nd-floor-escalator-up\",\"coordinates\":{\"x1\":0,\"y1\":0,\"x2\":100,\"y2\":100,\"x3\":50,\"y3\":50}},{\"passway_name\":\"2nd-floor-escalator-down\",\"coordinates\":{\"x1\":200,\"y1\":200,\"x2\":400,\"y2\":400,\"x3\":300,\"y3\":300}}]}"where 'data.json' looks like
post
https://counting.traces.cloud/
api/v1/object-counting
object-counting
curl -X POST "https://counting.traces.cloud/api/v1/object-counting/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "counting_options={ "classes": [ "people", "vehicle" ], "count_by_frames": false }" -F "[email protected]_video.mp4;type=video/mp4"
post
https://counting.traces.cloud/
api/v1/dwell-time-settings
dwell-time-settings
data.json
{
"camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e",
"spaces": [
{
"space_name": "main_entrance",
"coordinates": {
"x1": 0,
"y1": 0,
"x2": 100,
"y2": 100
}
}]
}
curl -X POST -H "Content-Type: application/json" -H "X-Traces-API-Key: YOUR_API_KEY" -d @data.json https://counting.traces.cloud/api/v1/dwell-time-settings
post
https://counting.traces.cloud/
api/v1/dwell-time-summary
dwell-time-summary
curl -X POST "https://counting.traces.cloud/api/v1/dwell-time-summary/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "[email protected]_video.mp4;type=video/mp4"
post
https://counting.traces.cloud/
api/v1/dwell-time-detailed
dwell-time-detailed
curl -X POST "https://counting.traces.cloud/api/v1/dwell-time-detailed/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "[email protected]_video.mp4;type=video/mp4"
Last modified 1yr ago