π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Simplify
laurenspriem6f6315869924
diff --git a/mobile/lib/db/ml/db.dart b/mobile/lib/db/ml/db.dartindex 79a0790754..a8e75befa6 100644--- a/mobile/lib/db/ml/db.dart+++ b/mobile/lib/db/ml/db.dart@@ -604,8 +604,6 @@ class MLDataDB {}Future<List<FaceDbInfoForClustering>> getFaceInfoForClustering({- double minScore = kMinimumQualityFaceScore,- int minClarity = kLaplacianHardThreshold,int maxFaces = 20000,int offset = 0,int batchSize = 10000,@@ -622,7 +620,7 @@ class MLDataDB {// Query a batch of rowsfinal List<Map<String, dynamic>> maps = await db.getAll('SELECT $faceIDColumn, $embeddingColumn, $faceScore, $faceBlur, $isSideways FROM $facesTable'- ' WHERE $faceScore > $minScore AND $faceBlur > $minClarity'+ ' WHERE $faceScore > $kMinimumQualityFaceScore AND $faceBlur > $kLaplacianHardThreshold'' ORDER BY $faceIDColumn'' DESC LIMIT $batchSize OFFSET $offset',);@@ -698,12 +696,10 @@ class MLDataDB {return result;}- Future<int> getTotalFaceCount({- double minFaceScore = kMinimumQualityFaceScore,- }) async {+ Future<int> getTotalFaceCount() async {final db = await instance.asyncDB;final List<Map<String, dynamic>> maps = await db.getAll(- 'SELECT COUNT(*) as count FROM $facesTable WHERE $faceScore > $minFaceScore AND $faceBlur > $kLaplacianHardThreshold',+ 'SELECT COUNT(*) as count FROM $facesTable WHERE $faceScore > $kMinimumQualityFaceScore AND $faceBlur > $kLaplacianHardThreshold',);return maps.first['count'] as int;}diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dartindex 929730b3a6..113827cbfc 100644--- a/mobile/lib/services/machine_learning/ml_service.dart+++ b/mobile/lib/services/machine_learning/ml_service.dart@@ -17,7 +17,6 @@ import "package:photos/services/filedata/filedata_service.dart";import "package:photos/services/filedata/model/file_data.dart";import 'package:photos/services/machine_learning/face_ml/face_clustering/face_clustering_service.dart';import "package:photos/services/machine_learning/face_ml/face_clustering/face_db_info_for_clustering.dart";-import 'package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart';import "package:photos/services/machine_learning/face_ml/person/person_service.dart";import "package:photos/services/machine_learning/ml_indexing_isolate.dart";import 'package:photos/services/machine_learning/ml_result.dart';@@ -238,10 +237,7 @@ class MLService {}}- Future<void> clusterAllImages({- double minFaceScore = kMinimumQualityFaceScore,- bool clusterInBuckets = true,- }) async {+ Future<void> clusterAllImages({bool clusterInBuckets = true}) async {if (_cannotRunMLFunction()) return;_logger.info("`clusterAllImages()` called");@@ -269,13 +265,12 @@ class MLService {// Get a sense of the total number of faces in the databasefinal int totalFaces =- await MLDataDB.instance.getTotalFaceCount(minFaceScore: minFaceScore);+ await MLDataDB.instance.getTotalFaceCount();final fileIDToCreationTime =await FilesDB.instance.getFileIDToCreationTime();final startEmbeddingFetch = DateTime.now();// read all embeddingsfinal result = await MLDataDB.instance.getFaceInfoForClustering(- minScore: minFaceScore,maxFaces: totalFaces,);final Set<int> missingFileIDs = {};