Training API Overview
The Valossa Training API allows you to create custom face galleries and train the system to recognize specific people in your video analysis jobs.
Base URL
https://api-eu.valossa.com/training/1.0/
Overview
By default, Valossa AI uses the Valossa Celebrities Gallery, which contains thousands of known public figures. The Face Training API lets you supplement this with your own custom galleries containing any face identities relevant to your use case.
Trained face identities appear in the similar_to fields of human.face detections in Valossa Core metadata.
Prerequisites
- A Valossa AI subscription that includes face-related functionality.
- Your existing API key (the same key used for video analysis works for face training).
Galleries
Default Gallery
When you start training custom faces without specifying a gallery, a default gallery is created automatically for your account. The default gallery:
- Is created implicitly on first use
- Cannot be named
- Is limited to one per account
- Is used automatically for video analysis if no gallery is specified in the
new_jobrequest
Non-Default Galleries
You can explicitly create additional non-default galleries for more advanced use cases:
- Each gallery has a name and a unique UUID
- You can create multiple non-default galleries
- Must be explicitly specified in the
new_jobrequest to be used
A common use case for multiple galleries is when you serve multiple customers, each needing their own set of face identities. By using separate galleries, Customer A's trained faces will not be applied to Customer B's video analysis jobs.
Workflow
1. Create a Gallery (Optional)
If you need a non-default gallery, create one first. The API returns the gallery's UUID.
2. Upload Face Images
Upload one or more images of each person you want the system to recognize. Use the upload_image function in the Training API. The more varied and high-quality images you provide for each person, the better the recognition accuracy.
3. Analyze Videos
Submit videos for analysis using new_job. Specify which gallery to use:
- Omit the gallery parameter: The default gallery is used.
- Specify a gallery UUID: The specified non-default gallery is used.
4. Read Results
Recognized faces appear in the similar_to array within the a (attributes) field of each human.face detection. Each match includes:
name-- The person's name as trainedc-- Confidence score (0.0 to 1.0)gallery.id-- UUID of the gallery the match came fromgallery_face.id-- UUID of the specific face identity within the gallerygallery_face.name-- Name of the person
API Methods
The Training API follows the same conventions as Core API:
- Read operations use HTTP
GET - Write/delete operations use HTTP
POST - Responses are JSON
- HTTP
200indicates success; non-200 indicates an error with details in theerrorsarray
Endpoints
| Function | Method | Description |
|---|---|---|
upload_image | POST | Upload a face image for training |
create_face_gallery | POST | Create a new non-default face gallery |
update_face_gallery | POST | Update a non-default gallery name |
list_face_galleries | GET | List all your face galleries |
create_face_identity | POST | Create a face identity in a gallery |
add_face_image | POST | Attach an uploaded image to a face identity |
list_face_identities | GET | List face identities in a gallery |
list_face_images | GET | List images assigned to one face identity |
update_face_identity | POST | Update face identity fields |
remove_face_image | POST | Remove one training image |
remove_face_identity | POST | Remove one face identity |
Detailed endpoint docs:
- POST /upload_image
- POST /create_face_gallery
- POST /update_face_gallery
- GET /list_face_galleries
- POST /create_face_identity
- POST /add_face_image
- GET /list_face_identities
- GET /list_face_images
- POST /update_face_identity
- POST /remove_face_image
- POST /remove_face_identity
Notes
- Training custom faces may cause some additional processing time for your video analysis jobs.
- Gallery management (creating, listing, deleting galleries) and face training (uploading images) can also be done through the Valossa Portal graphical interface.
- The gallery features and the
similar_to_face_idgrouping structure were introduced in Valossa Core metadata version1.3.4. Legacy gallery faces created before this version may not have face IDs (UUIDs) and thus cannot be found in thesimilar_to_face_idstructure.
Related Resources
- Faces & Identity -- How to read face detection results including bounding boxes
- Face Recognition Guide -- Step-by-step guide for face recognition workflows