Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Rearrange

Manav Rathi3f18fb84a107
diff --git a/web/apps/photos/src/services/face/f-index.ts b/web/apps/photos/src/services/face/f-index.ts
index 9df9123925..a1b7c94d98 100644
--- a/web/apps/photos/src/services/face/f-index.ts
+++ b/web/apps/photos/src/services/face/f-index.ts
@@ -266,25 +266,6 @@ const faceDetectionsFromYOLOOutput = (rows: Float32Array): FaceDetection[] => {
return faces;
};
-const getRelativeDetection = (
- faceDetection: FaceDetection,
- dimensions: Dimensions,
-): FaceDetection => {
- const oldBox: Box = faceDetection.box;
- const box = new Box({
- x: oldBox.x / dimensions.width,
- y: oldBox.y / dimensions.height,
- width: oldBox.width / dimensions.width,
- height: oldBox.height / dimensions.height,
- });
- const oldLandmarks: Point[] = faceDetection.landmarks;
- const landmarks = oldLandmarks.map((l) => {
- return new Point(l.x / dimensions.width, l.y / dimensions.height);
- });
- const probability = faceDetection.probability;
- return { box, landmarks, probability };
-};
-
/**
* Removes duplicate face detections from an array of detections.
*
@@ -740,6 +721,25 @@ const syncFileFaceMakeRelativeDetections = async (
}
};
+const getRelativeDetection = (
+ faceDetection: FaceDetection,
+ dimensions: Dimensions,
+): FaceDetection => {
+ const oldBox: Box = faceDetection.box;
+ const box = new Box({
+ x: oldBox.x / dimensions.width,
+ y: oldBox.y / dimensions.height,
+ width: oldBox.width / dimensions.width,
+ height: oldBox.height / dimensions.height,
+ });
+ const oldLandmarks: Point[] = faceDetection.landmarks;
+ const landmarks = oldLandmarks.map((l) => {
+ return new Point(l.x / dimensions.width, l.y / dimensions.height);
+ });
+ const probability = faceDetection.probability;
+ return { box, landmarks, probability };
+};
+
export const saveFaceCrop = async (imageBitmap: ImageBitmap, face: Face) => {
const faceCrop = getFaceCrop(imageBitmap, face.detection);