Classify and save a face training image
POSThttps://demo.frigate.video/api/faces/train/:name/classify
Adds a training image to a specific face name for face recognition. Accepts either a training file from the train directory or an event_id to extract the face from. The image is saved to the face's directory and the face classifier is cleared to incorporate the new training data. Returns a success message with the new filename or an error if face recognition is not enabled, the file/event is invalid, or the face cannot be extracted.
Request​
Path Parameters
name Namerequired
- application/json
Body
objectobject
Responses​
- 200
- 422
Successful Response
- application/json
- Schema
- Example (auto)
Schema
successSuccess (boolean)required
messageMessage (string)required
{
"success": true,
"message": "string"
}
Validation Error
- application/json
- Schema
- Example (auto)
Schema
detail object[]
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
- python
- nodejs
- javascript
- curl
- rust
- HTTP.CLIENT
- REQUESTS
import http.client
import json
conn = http.client.HTTPSConnection("demo.frigate.video")
payload = json.dumps({})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
conn.request("POST", "/api/faces/train/:name/classify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
ResponseClear