浏览代码

Rearrange

Manav Rathi 1 年之前
父节点
当前提交
3f18fb84a1
共有 1 个文件被更改,包括 19 次插入19 次删除
  1. 19 19
      web/apps/photos/src/services/face/f-index.ts

+ 19 - 19
web/apps/photos/src/services/face/f-index.ts

@@ -266,25 +266,6 @@ const faceDetectionsFromYOLOOutput = (rows: Float32Array): FaceDetection[] => {
     return faces;
     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.
  * 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) => {
 export const saveFaceCrop = async (imageBitmap: ImageBitmap, face: Face) => {
     const faceCrop = getFaceCrop(imageBitmap, face.detection);
     const faceCrop = getFaceCrop(imageBitmap, face.detection);