diff --git a/mobile/lib/face/db.dart b/mobile/lib/face/db.dart index 308bb2854..ae72b39dd 100644 --- a/mobile/lib/face/db.dart +++ b/mobile/lib/face/db.dart @@ -163,12 +163,12 @@ class FaceMLDataDB { Future> getPersonIgnoredClusters(String personID) async { final db = await instance.asyncDB; // find out clusterIds that are assigned to other persons using the clusters table - final List> maps = await db.getAll( + final List> otherPersonMaps = await db.getAll( 'SELECT $clusterIDColumn FROM $clusterPersonTable WHERE $personIdColumn != ? AND $personIdColumn IS NOT NULL', [personID], ); final Set ignoredClusterIDs = - maps.map((e) => e[clusterIDColumn] as int).toSet(); + otherPersonMaps.map((e) => e[clusterIDColumn] as int).toSet(); final List> rejectMaps = await db.getAll( 'SELECT $clusterIDColumn FROM $notPersonFeedback WHERE $personIdColumn = ?', [personID], diff --git a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart index e8fa9a522..f68bf95a5 100644 --- a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart +++ b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart @@ -246,6 +246,7 @@ class ClusterFeedbackService { }) async { final faceMlDb = FaceMLDataDB.instance; final faceIDs = await faceMlDb.getFaceIDsForCluster(personClusterID); + final ignoredClusters = await faceMlDb.getPersonIgnoredClusters(p.remoteID); if (faceIDs.length < 2 * kMinimumClusterSizeSearchResult) { final fileIDs = faceIDs.map(getFileIdFromFaceId).toSet(); if (fileIDs.length < kMinimumClusterSizeSearchResult) { @@ -264,7 +265,7 @@ class ClusterFeedbackService { final EnteWatch watch = EnteWatch("ClusterFeedbackService")..start(); final Map clusterAvg = await _getUpdateClusterAvg( allClusterIdsToCountMap, - {}, + ignoredClusters, minClusterSize: kMinimumClusterSizeSearchResult, ); watch.log('computed avg for ${clusterAvg.length} clusters'); @@ -273,8 +274,8 @@ class ClusterFeedbackService { final List<(int, double)> suggestions = await calcSuggestionsMeanInComputer( clusterAvg, {personClusterID}, - {}, - 0.34, + ignoredClusters, + 0.32, ); if (suggestions.isEmpty) {