curl --request POST \
--url http://localhost:6699/api/v1/faces/recluster \
--header 'Content-Type: application/json' \
--header 'X-License-Key: <api-key>' \
--data '
{
"cache_dir": "<string>",
"cluster_job_name": "<string>",
"eps": 0.48,
"min_samples": 5,
"auto_detect_params": false,
"clear_names": false
}
'import requests
url = "http://localhost:6699/api/v1/faces/recluster"
payload = {
"cache_dir": "<string>",
"cluster_job_name": "<string>",
"eps": 0.48,
"min_samples": 5,
"auto_detect_params": False,
"clear_names": False
}
headers = {
"X-License-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-License-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cache_dir: '<string>',
cluster_job_name: '<string>',
eps: 0.48,
min_samples: 5,
auto_detect_params: false,
clear_names: false
})
};
fetch('http://localhost:6699/api/v1/faces/recluster', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6699",
CURLOPT_URL => "http://localhost:6699/api/v1/faces/recluster",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cache_dir' => '<string>',
'cluster_job_name' => '<string>',
'eps' => 0.48,
'min_samples' => 5,
'auto_detect_params' => false,
'clear_names' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-License-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:6699/api/v1/faces/recluster"
payload := strings.NewReader("{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-License-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:6699/api/v1/faces/recluster")
.header("X-License-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6699/api/v1/faces/recluster")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-License-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}"
response = http.request(request)
puts response.read_bodyRe-run face clustering
Re-groups the collection’s existing face detections with new settings. Runs in the background. The 202 response returns a task_id.
The last progress event has done: true. A re-grouping that fails or is
cancelled ends with done: true and an error; a cancelled one also has
cancelled: true, and the groups are left as they were. A client that joins the
task_id room after the re-grouping ended gets its last progress event as
last_event in the acknowledgement of the join.
While another job is changing the collection, the re-grouping waits for it and
says so every 5 seconds with a progress event that has waiting: true.
/analyze/cancel cancels it while it waits and while it groups.
Legacy face collections are read-only except for naming groups.
Re-clustering requires no other analysis task to be running.
Cluster IDs change. Every cluster gets a new ID. Fetch the IDs again when the task finishes. User-assigned names carry over: each new cluster takes the name most of its faces had before. Set clear_names to start without names. Faces that couldn’t be saved to the collection earlier are added first.
The eps and min_samples used are saved for the collection in
people/<cluster_job_name>/clustering_recipe.json inside cache_dir.
Later analyses into the collection reuse them unless they pass their own.
The Jumper UI offers these presets (eps / min_samples): Very Loose 0.7 / 3,
Loose 0.6 / 4, Balanced 0.48 / 5, Strict 0.4 / 5, Very Strict 0.3 / 6,
Ultra Strict 0.24 / 6.
Progress events. Connect to Socket.IO at http://localhost:6699, emit join with the task_id,
and listen for progress events. progress is a decimal string.
- While running:
{"progress": "45.00", "video_path": null, "done": false, "is_cluster_job": true, "cluster_job_name": "Interview Faces"}. Events can also carrycluster_media_hashes, the hashes of the collection’s fully analyzed files. - Finished:
done: trueandprogress: "100.00", usually withcluster_media_hashes. - Failed or cancelled:
done: true,progress: "100.00", and anerrormessage. A cancelled regroup also hascancelled: true. No further events follow.
Events aren’t replayed. A small collection can finish before you join the room. GET /faces/clusters then already shows the new cluster IDs.
curl --request POST \
--url http://localhost:6699/api/v1/faces/recluster \
--header 'Content-Type: application/json' \
--header 'X-License-Key: <api-key>' \
--data '
{
"cache_dir": "<string>",
"cluster_job_name": "<string>",
"eps": 0.48,
"min_samples": 5,
"auto_detect_params": false,
"clear_names": false
}
'import requests
url = "http://localhost:6699/api/v1/faces/recluster"
payload = {
"cache_dir": "<string>",
"cluster_job_name": "<string>",
"eps": 0.48,
"min_samples": 5,
"auto_detect_params": False,
"clear_names": False
}
headers = {
"X-License-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-License-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cache_dir: '<string>',
cluster_job_name: '<string>',
eps: 0.48,
min_samples: 5,
auto_detect_params: false,
clear_names: false
})
};
fetch('http://localhost:6699/api/v1/faces/recluster', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6699",
CURLOPT_URL => "http://localhost:6699/api/v1/faces/recluster",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cache_dir' => '<string>',
'cluster_job_name' => '<string>',
'eps' => 0.48,
'min_samples' => 5,
'auto_detect_params' => false,
'clear_names' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-License-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:6699/api/v1/faces/recluster"
payload := strings.NewReader("{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-License-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:6699/api/v1/faces/recluster")
.header("X-License-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6699/api/v1/faces/recluster")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-License-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cache_dir\": \"<string>\",\n \"cluster_job_name\": \"<string>\",\n \"eps\": 0.48,\n \"min_samples\": 5,\n \"auto_detect_params\": false,\n \"clear_names\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Body
Was this page helpful?

