From 1f6be04bf4c48558aad45ac99534f15023144331 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 30 May 2024 15:57:27 +0530 Subject: [PATCH] Rename --- web/apps/photos/src/services/face/f-index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/apps/photos/src/services/face/f-index.ts b/web/apps/photos/src/services/face/f-index.ts index 4bf829ff6f..a0faaea34b 100644 --- a/web/apps/photos/src/services/face/f-index.ts +++ b/web/apps/photos/src/services/face/f-index.ts @@ -110,12 +110,12 @@ const indexFacesInBitmap = async ( imageBitmap: ImageBitmap, ): Promise => { const { width, height } = imageBitmap; - const imageBox = { width, height }; + const imageDimensions = { width, height }; const yoloFaceDetections = await detectFaces(imageBitmap); const partialResult = yoloFaceDetections.map( ({ box, landmarks, score }) => { - const faceID = makeFaceID(fileID, box, imageBox); + const faceID = makeFaceID(fileID, box, imageDimensions); const detection = { box, landmarks }; return { faceID, detection, score }; }, @@ -150,7 +150,7 @@ const indexFacesInBitmap = async ( return partialResult.map(({ faceID, detection, score }, i) => ({ faceID, - detection: relativeDetection(detection, imageBox), + detection: normalizeToImageDimensions(detection, imageDimensions), score, blur: blurs[i], embedding: Array.from(embeddings[i]), @@ -742,7 +742,7 @@ const computeEmbeddings = async ( /** * Convert the coordinates to between 0-1, normalized by the image's dimensions. */ -const relativeDetection = ( +const normalizeToImageDimensions = ( faceDetection: FaceDetection, { width, height }: Dimensions, ): FaceDetection => {