diff --git a/mobile/lib/services/machine_learning/face_ml/face_detection/face_detection_service.dart b/mobile/lib/services/machine_learning/face_ml/face_detection/face_detection_service.dart index 662e1a778b..43f971158c 100644 --- a/mobile/lib/services/machine_learning/face_ml/face_detection/face_detection_service.dart +++ b/mobile/lib/services/machine_learning/face_ml/face_detection/face_detection_service.dart @@ -8,6 +8,7 @@ import 'package:onnxruntime/onnxruntime.dart'; import "package:photos/models/ml/face/dimension.dart"; import 'package:photos/services/machine_learning/face_ml/face_detection/detection.dart'; import "package:photos/services/machine_learning/face_ml/face_detection/face_detection_postprocessing.dart"; +import "package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart"; import "package:photos/services/machine_learning/ml_model.dart"; import "package:photos/utils/image_ml_util.dart"; @@ -31,7 +32,7 @@ class FaceDetectionService extends MlModel { static const int kInputWidth = 640; static const int kInputHeight = 640; static const double kIouThreshold = 0.4; - static const double kMinScoreSigmoidThreshold = 0.5; + static const double kMinScoreSigmoidThreshold = kMinFaceDetectionScore; static const int kNumKeypoints = 5; // Singleton pattern diff --git a/mobile/lib/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart b/mobile/lib/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart index f8ac9e6130..b20af3a2e6 100644 --- a/mobile/lib/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart +++ b/mobile/lib/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart @@ -1,5 +1,3 @@ -import 'package:photos/services/machine_learning/face_ml/face_detection/face_detection_service.dart'; - /// Blur detection threshold const kLaplacianHardThreshold = 10; const kLaplacianSoftThreshold = 50; @@ -8,6 +6,9 @@ const kLaplacianVerySoftThreshold = 200; /// Default blur value const kLapacianDefault = 10000.0; +/// The minimum score for a face to be detected, regardless of quality. Use [kMinimumQualityFaceScore] for high quality faces. +const kMinFaceDetectionScore = 0.5; + /// The minimum score for a face to be shown as detected in the UI const kMinimumFaceShowScore = 0.75; @@ -16,9 +17,6 @@ const kMinimumQualityFaceScore = 0.80; const kMediumQualityFaceScore = 0.85; const kHighQualityFaceScore = 0.90; -/// The minimum score for a face to be detected, regardless of quality. Use [kMinimumQualityFaceScore] for high quality faces. -const kMinFaceDetectionScore = FaceDetectionService.kMinScoreSigmoidThreshold; - /// The minimum cluster size for displaying a cluster in the UI by default const kMinimumClusterSizeSearchResult = 10;