Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathia161203d0be1
diff --git a/web/apps/photos/src/services/face/f-index.ts b/web/apps/photos/src/services/face/f-index.ts
index 0e68a133bf..70734daca8 100644
--- a/web/apps/photos/src/services/face/f-index.ts
+++ b/web/apps/photos/src/services/face/f-index.ts
@@ -113,8 +113,10 @@ const indexFaces_ = async (enteFile: EnteFile, imageBitmap: ImageBitmap) => {
}));
newMlFile.faces = detectedFaces;
- if (newMlFile.faces && newMlFile.faces.length > 0) {
- await syncFileFaceCrops(fileContext);
+ if (detectedFaces.length > 0) {
+ await Promise.all(
+ detectedFaces.map((face) => saveFaceCrop(imageBitmap, face)),
+ );
const alignedFacesData = await syncFileFaceAlignments(fileContext);
@@ -339,14 +341,6 @@ const makeFaceID = (
return [`${fileID}`, xMin, yMin, xMax, yMax].join("_");
};
-const syncFileFaceCrops = async (fileContext: MLSyncFileContext) => {
- const { newMlFile } = fileContext;
- const imageBitmap = fileContext.imageBitmap;
- for (const face of newMlFile.faces) {
- await saveFaceCrop(imageBitmap, face);
- }
-};
-
const syncFileFaceAlignments = async (
fileContext: MLSyncFileContext,
): Promise<Float32Array> => {