Face Recognition / People Integration #61
12
src/faces.rs
12
src/faces.rs
@@ -154,6 +154,14 @@ pub struct FaceEmbeddingRow {
|
|||||||
pub model_version: String,
|
pub model_version: String,
|
||||||
/// base64 of 2048 bytes (512×f32 LE).
|
/// base64 of 2048 bytes (512×f32 LE).
|
||||||
pub embedding: String,
|
pub embedding: String,
|
||||||
|
/// Normalized bbox 0..1, included so the cluster suggester UI can
|
||||||
|
/// crop a face thumbnail without an extra round-trip per cluster.
|
||||||
|
/// Shouldn't be NULL for `status='detected'` rows (CHECK constraint
|
||||||
|
/// in the migration), but the DB type is nullable so we mirror it.
|
||||||
|
pub bbox_x: Option<f32>,
|
||||||
|
pub bbox_y: Option<f32>,
|
||||||
|
pub bbox_w: Option<f32>,
|
||||||
|
pub bbox_h: Option<f32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug, Default)]
|
#[derive(Serialize, Debug, Default)]
|
||||||
@@ -1846,6 +1854,10 @@ async fn embeddings_handler<D: FaceDao>(
|
|||||||
person_id: r.person_id,
|
person_id: r.person_id,
|
||||||
model_version: r.model_version,
|
model_version: r.model_version,
|
||||||
embedding: b64,
|
embedding: b64,
|
||||||
|
bbox_x: r.bbox_x,
|
||||||
|
bbox_y: r.bbox_y,
|
||||||
|
bbox_w: r.bbox_w,
|
||||||
|
bbox_h: r.bbox_h,
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
HttpResponse::Ok().json(out)
|
HttpResponse::Ok().json(out)
|
||||||
|
|||||||
Reference in New Issue
Block a user