Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Show face area info in debug mode

laurenspriem0777013b9375
diff --git a/mobile/lib/face/model/detection.dart b/mobile/lib/face/model/detection.dart
index 8043ed9856..1ffaa1eb3d 100644
--- a/mobile/lib/face/model/detection.dart
+++ b/mobile/lib/face/model/detection.dart
@@ -43,6 +43,11 @@ class Detection {
);
}
+ // TODO: iterate on better area calculation, potentially using actual indexing image dimensions instead of file metadata
+ int getFaceArea(int imageWidth, int imageHeight) {
+ return (box.width * imageWidth * box.height * imageHeight).toInt();
+ }
+
// TODO: iterate on better scoring logic, current is a placeholder
int getVisibilityScore() {
final double aspectRatio = box.width / box.height;
diff --git a/mobile/lib/ui/viewer/file_details/face_widget.dart b/mobile/lib/ui/viewer/file_details/face_widget.dart
index 7e94452356..9ee41add2b 100644
--- a/mobile/lib/ui/viewer/file_details/face_widget.dart
+++ b/mobile/lib/ui/viewer/file_details/face_widget.dart
@@ -174,6 +174,12 @@ class _FaceWidgetState extends State<FaceWidget> {
style: Theme.of(context).textTheme.bodySmall,
maxLines: 1,
),
+ if (kDebugMode)
+ Text(
+ 'A: ${widget.face.detection.getFaceArea(widget.file.width, widget.file.height)}',
+ style: Theme.of(context).textTheme.bodySmall,
+ maxLines: 1,
+ ),
// if (kDebugMode)
// if (highlight)
// const Text(