[mob] Show face area info in debug mode

This commit is contained in:
laurenspriem 2024-04-05 14:34:47 +05:30
parent 04a33e6f65
commit 0777013b93
2 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -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(