Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Fix in clustering without buckets

laurenspriemba107c2d25bb
diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
index 3ca56590b2..f2a824ed20 100644
--- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
+++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
@@ -420,11 +420,15 @@ class FaceMlService {
offset += offsetIncrement;
}
} else {
+ final int totalFaces = await FaceMLDataDB.instance
+ .getTotalFaceCount(minFaceScore: minFaceScore);
+
// Read all the embeddings from the database, in a map from faceID to embedding
final clusterStartTime = DateTime.now();
final faceIdToEmbedding =
await FaceMLDataDB.instance.getFaceEmbeddingMap(
minScore: minFaceScore,
+ maxFaces: totalFaces,
);
final gotFaceEmbeddingsTime = DateTime.now();
_logger.info(