[mob] Hide smaller clusters only when there are more than 2 clusters

This commit is contained in:
Neeraj Gupta 2024-04-05 18:48:44 +05:30
parent add66569dd
commit f261ee7184
3 changed files with 8 additions and 3 deletions

View file

@ -496,4 +496,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: c1a8f198a245ed1f10e40b617efdb129b021b225
COCOAPODS: 1.15.2
COCOAPODS: 1.14.3

View file

@ -409,6 +409,9 @@ class FaceMLDataDB {
}
offset += batchSize;
}
_logger.info(
'done reading face embeddings ${result.length}',
);
return result;
}
@ -493,7 +496,8 @@ class FaceMLDataDB {
}
Future<void> bulkAssignClusterToPersonID(
Map<int, String> clusterToPersonID,) async {
Map<int, String> clusterToPersonID,
) async {
final db = await instance.database;
final batch = db.batch();
for (final entry in clusterToPersonID.entries) {
@ -505,6 +509,7 @@ class FaceMLDataDB {
personIdColumn: personID,
cluserIDColumn: clusterID,
},
conflictAlgorithm: ConflictAlgorithm.replace,
);
}
await batch.commit(noResult: true);

View file

@ -823,7 +823,7 @@ class SearchService {
throw Exception(
"Cluster $clusterId should not have person id ${clusterIDToPersonID[clusterId]}");
}
if (files.length < 3) {
if (files.length < 3 && sortedClusterIds.length > 3) {
continue;
}
facesResult.add(