From c2e28fbc69030cdf0b63667942d3d5458cd9bf60 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 14 May 2025 14:14:24 -0600 Subject: [PATCH] Move time ago to card info and add face area --- web/src/pages/FaceLibrary.tsx | 37 +++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/web/src/pages/FaceLibrary.tsx b/web/src/pages/FaceLibrary.tsx index 22b22b379..975a89c79 100644 --- a/web/src/pages/FaceLibrary.tsx +++ b/web/src/pages/FaceLibrary.tsx @@ -853,11 +853,18 @@ function FaceAttemptGroup({ }} >
-
- Person - {event?.sub_label - ? `: ${event.sub_label} (${Math.round((event.data.sub_label_score || 0) * 100)}%)` - : ": " + t("details.unknown")} +
+
+ Person + {event?.sub_label + ? `: ${event.sub_label} (${Math.round((event.data.sub_label_score || 0) * 100)}%)` + : ": " + t("details.unknown")} +
+
{event && ( @@ -950,6 +957,14 @@ function FaceAttempt({ onClick(data, true); }); + const imageArea = useMemo(() => { + if (!imgRef.current) { + return undefined; + } + + return imgRef.current.naturalWidth * imgRef.current.naturalHeight; + }, [imgRef]); + // api calls const onTrainAttempt = useCallback( @@ -1021,13 +1036,11 @@ function FaceAttempt({ onClick(data, e.metaKey || e.ctrlKey); }} /> -
- -
+ {imageArea != undefined && ( +
+ {imageArea}px +
+ )}