This commit is contained in:
Manav Rathi
2024-05-30 13:48:36 +05:30
parent 4b202d2dda
commit 6d3391528d
3 changed files with 7 additions and 6 deletions

View File

@@ -105,7 +105,8 @@ const indexFaces_ = async (enteFile: EnteFile, imageBitmap: ImageBitmap) => {
const mlFile: MlFileData = {
fileID: fileID,
mlVersion: defaultMLVersion,
imageDimensions,
width,
height,
errorCount: 0,
};

View File

@@ -116,7 +116,6 @@ function LocalFileMlDataToServerFileMl(
if (localFileMlData.errorCount > 0) {
return null;
}
const imageDimensions = localFileMlData.imageDimensions;
const faces: ServerFace[] = [];
for (let i = 0; i < localFileMlData.faces.length; i++) {
@@ -143,7 +142,7 @@ function LocalFileMlDataToServerFileMl(
return new ServerFileMl(
localFileMlData.fileID,
faceEmbeddings,
imageDimensions.height,
imageDimensions.width,
localFileMlData.height,
localFileMlData.width,
);
}

View File

@@ -1,4 +1,4 @@
import type { Box, Dimensions, Point } from "./types";
import type { Box, Point } from "./types";
export interface FaceDetection {
// box and landmarks is relative to image dimentions stored at mlFileData
@@ -19,7 +19,8 @@ export interface Face {
export interface MlFileData {
fileID: number;
faces?: Face[];
imageDimensions?: Dimensions;
width: number;
height: number;
mlVersion: number;
errorCount: number;
}