This commit is contained in:
Manav Rathi
2024-05-30 14:17:31 +05:30
parent b5c52a4ae2
commit 57404e1f49
4 changed files with 5 additions and 3 deletions

View File

@@ -117,6 +117,7 @@ const indexFaces_ = async (
faceEmbedding: {
version: 1,
client: userAgent,
faces: [],
},
mlVersion: defaultMLVersion,
errorCount: 0,
@@ -124,8 +125,7 @@ const indexFaces_ = async (
const faceDetections = await detectFaces(imageBitmap);
const detectedFaces = faceDetections.map((detection) => ({
id: makeFaceID(fileID, detection, imageDimensions),
fileId: fileID,
faceID: makeFaceID(fileID, detection, imageDimensions),
detection,
}));
mlFile.faceEmbedding.faces = detectedFaces;

View File

@@ -272,6 +272,7 @@ export const syncLocalFiles = async (userID: number) => {
fileID,
mlVersion: 0,
errorCount: 0,
faceEmbedding: { faces: [] },
}) as MinimalPersistedFileData,
);
await mlIDbStorage.putAllFiles(newFiles, tx);

View File

@@ -22,7 +22,7 @@ export interface MlFileData {
faceEmbedding: {
version: number;
client: string;
faces?: Face[];
faces: Face[];
};
mlVersion: number;
errorCount: number;

View File

@@ -85,6 +85,7 @@ class MachineLearningService {
fileID,
mlVersion: 0,
errorCount: 0,
faceEmbedding: { faces: [] },
} as MinimalPersistedFileData;
}