{
- navigate(`/explore?event_id=${event.id}`);
+ navigate(`/explore?event_id=${classifiedEvent.id}`);
}}
>
diff --git a/web/src/pages/FaceLibrary.tsx b/web/src/pages/FaceLibrary.tsx
index 0f281895e..0a2789c00 100644
--- a/web/src/pages/FaceLibrary.tsx
+++ b/web/src/pages/FaceLibrary.tsx
@@ -68,7 +68,10 @@ import {
ClassificationCard,
GroupedClassificationCard,
} from "@/components/card/ClassificationCard";
-import { ClassificationItemData } from "@/types/classification";
+import {
+ ClassificationItemData,
+ ClassifiedEvent,
+} from "@/types/classification";
export default function FaceLibrary() {
const { t } = useTranslation(["views/faceLibrary"]);
@@ -922,10 +925,22 @@ function FaceAttemptGroup({
[onRefresh, t],
);
+ // Create ClassifiedEvent from Event (face recognition uses sub_label)
+ const classifiedEvent: ClassifiedEvent | undefined = useMemo(() => {
+ if (!event || !event.sub_label || event.sub_label === "none") {
+ return undefined;
+ }
+ return {
+ id: event.id,
+ label: event.sub_label,
+ score: event.data?.sub_label_score,
+ };
+ }, [event]);
+
return (
{
+ if (!event || !model.object_config) {
+ return undefined;
+ }
+
+ const classificationType = model.object_config.classification_type;
+
+ if (classificationType === "attribute") {
+ // For attribute type, look at event.data[model.name]
+ const attributeValue = event.data[model.name] as string | undefined;
+ const attributeScore = event.data[`${model.name}_score`] as
+ | number
+ | undefined;
+
+ if (attributeValue && attributeValue !== "none") {
+ return {
+ id: event.id,
+ label: attributeValue,
+ score: attributeScore,
+ };
+ }
+ } else {
+ // For sub_label type, use event.sub_label
+ if (event.sub_label && event.sub_label !== "none") {
+ return {
+ id: event.id,
+ label: event.sub_label,
+ score: event.data?.sub_label_score,
+ };
+ }
+ }
+
+ return undefined;
+ },
+ [model],
+ );
+
// selection
const [selectedEvent, setSelectedEvent] = useState();
@@ -1095,11 +1135,13 @@ function ObjectTrainGrid({
>
{Object.entries(groups).map(([key, group]) => {
const event = events?.find((ev) => ev.id == key);
+ const classifiedEvent = createClassifiedEvent(event);
+
return (