[mob] Conservative threshold for combination of low score and blur

This commit is contained in:
laurenspriem
2024-04-19 15:57:11 +05:30
parent a92081e703
commit 4095b14589
2 changed files with 5 additions and 0 deletions

View File

@@ -454,6 +454,8 @@ class FaceClusteringService {
blurValue: face.blurValue,
badFace: face.faceScore < kMinimumQualityFaceScore ||
face.blurValue < kLaplacianSoftThreshold ||
(face.blurValue < kLaplacianVerySoftThreshold &&
face.faceScore < kMediumQualityFaceScore) ||
face.isSideways,
vEmbedding: Vector.fromList(
EVector.fromBuffer(face.embeddingBytes).values,

View File

@@ -3,12 +3,15 @@ import 'package:photos/services/machine_learning/face_ml/face_detection/face_det
/// Blur detection threshold
const kLaplacianHardThreshold = 15;
const kLaplacianSoftThreshold = 100;
const kLaplacianVerySoftThreshold = 200;
/// Default blur value
const kLapacianDefault = 10000.0;
/// The minimum score for a face to be considered a high quality face for clustering and person detection
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;