v1
latestOpenAPI 3.0.32026-07-26214565.6 KBFace Detection
Detect Faces in Video or Image
Unified endpoint to detect faces in either video or image from URL or base64-encoded image data.
This endpoint:
- Auto-detects media type (video/image) based on URL
- Downloads media from the provided URL asynchronously (or decodes base64 image)
- Processes media (extracts frames for video, loads image for image)
- Detects faces using InsightFace with face tracking for videos
- Returns bounding boxes and 6-point landmarks for each detected face
- For videos, tracks faces across frames and marks previous positions as removed
- Optionally returns cropped face image URLs (when return_face_url=true)
- Optionally returns only the largest face (when single_face=true)
Input Modes:
- URL mode: provide url parameter with image/video URL
- Base64 mode: provide img parameter with base64-encoded image data
- If both are provided, url takes priority
post/detect_faces
Request body
Example request
{
"url": "https://example.com/media.mp4",
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"num_frames": 5,
"deduplicate": true
}Response
Face detection completed successfully
Example response
{
"error_msg": "SUCCESS",
"faces_obj": {
"0": {
"landmarks": [
[
[
120,
85
],
[
180,
88
],
[
150,
130
],
[
150,
165
],
[
125,
165
],
[
175,
168
]
]
],
"landmarks_str": [
"120,85:180,88:150,130:150,165"
],
"region": [
[
80,
50,
150,
180
]
],
"removed": [],
"frame_time": null,
"face_urls": null,
"crop_region": null,
"crop_landmarks": null
}
}
}