[mob][photos] Force clustering on unclustered face

This commit is contained in:
laurenspriem
2025-01-16 17:55:39 +05:30
parent d9fc53137d
commit 57e8eb7c03
2 changed files with 8 additions and 2 deletions

View File

@@ -237,8 +237,11 @@ class MLService {
}
}
Future<void> clusterAllImages({bool clusterInBuckets = true}) async {
if (!_canRunMLFunction(function: "Clustering")) return;
Future<void> clusterAllImages({
bool clusterInBuckets = true,
bool force = false,
}) async {
if (!_canRunMLFunction(function: "Clustering") && !force) return;
if (_clusteringIsHappening) {
_logger.info("clusterAllImages() is already running, returning");
return;

View File

@@ -1,3 +1,4 @@
import "dart:async";
import "dart:developer" show log;
import "dart:typed_data";
@@ -13,6 +14,7 @@ import "package:photos/models/ml/face/person.dart";
import "package:photos/services/machine_learning/face_ml/face_detection/detection.dart";
import "package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart";
import "package:photos/services/machine_learning/face_ml/feedback/cluster_feedback.dart";
import "package:photos/services/machine_learning/ml_service.dart";
import "package:photos/services/search_service.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
@@ -121,6 +123,7 @@ class _FaceWidgetState extends State<FaceWidget> {
context,
S.of(context).faceNotClusteredYet,
);
unawaited(MLService.instance.clusterAllImages(force: true));
return;
}
if (widget.person != null) {