From f3d18edf986cf4499ac2b1c77ef0b12d2bd1c29b Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Wed, 10 Apr 2024 12:21:15 +0530 Subject: [PATCH] [mob] Better logging of face landmarks --- mobile/lib/face/model/landmark.dart | 9 +++++++-- .../machine_learning/face_ml/face_ml_service.dart | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mobile/lib/face/model/landmark.dart b/mobile/lib/face/model/landmark.dart index 13808c56b0..320afbabd1 100644 --- a/mobile/lib/face/model/landmark.dart +++ b/mobile/lib/face/model/landmark.dart @@ -1,5 +1,5 @@ -/// Landmark coordinate data. -/// +/// Landmark coordinate data. +/// /// WARNING: All coordinates are relative to the image size, so in the range [0, 1]! class Landmark { double x; @@ -25,4 +25,9 @@ class Landmark { : json['y'] as double), ); } + + @override + toString() { + return '(x: ${x.toStringAsFixed(4)}, y: ${y.toStringAsFixed(4)})'; + } } diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart index d32a7f2bb0..efd5a1c70f 100644 --- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart +++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart @@ -494,10 +494,10 @@ class FaceMlService { } if (allLandmarksEqual) { debugPrint("Discarding remote embedding for fileID ${fileMl.fileID} " - "because landmarks are not equal"); + "because landmarks are equal"); debugPrint( fileMl.faceEmbedding.faces - .map((e) => e.detection.landmarks) + .map((e) => e.detection.landmarks.toString()) .toList() .toString(), );