diff --git a/src/faces.rs b/src/faces.rs index 0d06675..769974d 100644 --- a/src/faces.rs +++ b/src/faces.rs @@ -154,6 +154,14 @@ pub struct FaceEmbeddingRow { pub model_version: String, /// base64 of 2048 bytes (512×f32 LE). 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, + pub bbox_y: Option, + pub bbox_w: Option, + pub bbox_h: Option, } #[derive(Serialize, Debug, Default)] @@ -1846,6 +1854,10 @@ async fn embeddings_handler( person_id: r.person_id, model_version: r.model_version, embedding: b64, + bbox_x: r.bbox_x, + bbox_y: r.bbox_y, + bbox_w: r.bbox_w, + bbox_h: r.bbox_h, }) .collect(); HttpResponse::Ok().json(out)