Explorar el Código

[mob] Storge cluster summary in batches

Neeraj Gupta hace 1 año
padre
commit
44a5b97de1

+ 5 - 0
mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart

@@ -387,6 +387,11 @@ class ClusterFeedbackService {
         updatesForClusterSummary[clusterID] =
         updatesForClusterSummary[clusterID] =
             (avgEmbeedingBuffer, embedings.length);
             (avgEmbeedingBuffer, embedings.length);
       }
       }
+      // store the intermediate updates
+      if (updatesForClusterSummary.length > 100) {
+        await faceMlDb.clusterSummaryUpdate(updatesForClusterSummary);
+        updatesForClusterSummary.clear();
+      }
       clusterAvg[clusterID] = avg;
       clusterAvg[clusterID] = avg;
     }
     }
     if (updatesForClusterSummary.isNotEmpty) {
     if (updatesForClusterSummary.isNotEmpty) {