diff --git a/mobile/lib/face/model/person.dart b/mobile/lib/face/model/person.dart index ea7ab3d5d7..c1e6105c17 100644 --- a/mobile/lib/face/model/person.dart +++ b/mobile/lib/face/model/person.dart @@ -23,13 +23,13 @@ class PersonAttr { final bool isHidden; String? avatarFaceId; final List faces; - final String? birthDatae; + final String? birthDate; PersonAttr({ required this.name, required this.faces, this.avatarFaceId, this.isHidden = false, - this.birthDatae, + this.birthDate, }); // copyWith PersonAttr copyWith({ @@ -37,14 +37,14 @@ class PersonAttr { List? faces, String? avatarFaceId, bool? isHidden, - String? birthDatae, + String? birthDate, }) { return PersonAttr( name: name ?? this.name, faces: faces ?? this.faces, avatarFaceId: avatarFaceId ?? this.avatarFaceId, isHidden: isHidden ?? this.isHidden, - birthDatae: birthDatae ?? this.birthDatae, + birthDate: birthDate ?? this.birthDate, ); } @@ -54,7 +54,7 @@ class PersonAttr { 'faces': faces.toList(), 'avatarFaceId': avatarFaceId, 'isHidden': isHidden, - 'birthDatae': birthDatae, + 'birthDate': birthDate, }; // fromJson @@ -64,7 +64,7 @@ class PersonAttr { faces: List.from(json['faces'] as List), avatarFaceId: json['avatarFaceId'] as String?, isHidden: json['isHidden'] as bool? ?? false, - birthDatae: json['birthDatae'] as String?, + birthDate: json['birthDatae'] as String?, ); } } diff --git a/mobile/lib/services/machine_learning/face_ml/face_clustering/linear_clustering_service.dart b/mobile/lib/services/machine_learning/face_ml/face_clustering/linear_clustering_service.dart index 5e0855eb47..09dc398891 100644 --- a/mobile/lib/services/machine_learning/face_ml/face_clustering/linear_clustering_service.dart +++ b/mobile/lib/services/machine_learning/face_ml/face_clustering/linear_clustering_service.dart @@ -273,7 +273,8 @@ class FaceLinearClustering { // Make sure the first face has a clusterId final int totalFaces = sortedFaceInfos.length; - int clusterID = 1; + // set current epoch time as clusterID + int clusterID = DateTime.now().millisecondsSinceEpoch; if (sortedFaceInfos.isNotEmpty) { if (sortedFaceInfos.first.clusterId == null) { sortedFaceInfos.first.clusterId = clusterID; 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 bb91de4191..e762058da2 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 @@ -405,6 +405,11 @@ class ClusterFeedbackService { updatesForClusterSummary[clusterID] = (avgEmbeedingBuffer, embedings.length); } + // store the intermediate updates + if (updatesForClusterSummary.length > 100) { + await faceMlDb.clusterSummaryUpdate(updatesForClusterSummary); + updatesForClusterSummary.clear(); + } clusterAvg[clusterID] = avg; } if (updatesForClusterSummary.isNotEmpty) {