Переглянути джерело

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

Neeraj Gupta 1 рік тому
батько
коміт
f261ee7184

+ 1 - 1
mobile/ios/Podfile.lock

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

+ 6 - 1
mobile/lib/face/db.dart

@@ -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);

+ 1 - 1
mobile/lib/services/search_service.dart

@@ -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(