From f3ce503f76df0644ff91d5b2890fd10d3c4dea1b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 7 Oct 2025 09:13:46 -0600 Subject: [PATCH] Cleanup --- web/public/locales/en/views/faceLibrary.json | 1 - web/src/components/card/ClassificationCard.tsx | 5 ++++- web/src/pages/FaceLibrary.tsx | 1 + web/src/views/classification/ModelTrainingView.tsx | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web/public/locales/en/views/faceLibrary.json b/web/public/locales/en/views/faceLibrary.json index 7f4c3a5b9..3a0804511 100644 --- a/web/public/locales/en/views/faceLibrary.json +++ b/web/public/locales/en/views/faceLibrary.json @@ -5,7 +5,6 @@ "invalidName": "Invalid name. Names can only include letters, numbers, spaces, apostrophes, underscores, and hyphens." }, "details": { - "person": "Person", "subLabelScore": "Sub Label Score", "scoreInfo": "The sub label score is the weighted score for all of the recognized face confidences, so this may differ from the score shown on the snapshot.", "face": "Face Details", diff --git a/web/src/components/card/ClassificationCard.tsx b/web/src/components/card/ClassificationCard.tsx index e0f1385cc..5153b6d71 100644 --- a/web/src/components/card/ClassificationCard.tsx +++ b/web/src/components/card/ClassificationCard.tsx @@ -14,6 +14,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; import { LuSearch } from "react-icons/lu"; import { TooltipPortal } from "@radix-ui/react-tooltip"; import { useNavigate } from "react-router-dom"; +import { getTranslatedLabel } from "@/utils/i18n"; type ClassificationCardProps = { className?: string; @@ -133,6 +134,7 @@ type GroupedClassificationCardProps = { threshold?: ClassificationThreshold; selectedItems: string[]; i18nLibrary: string; + objectType: string; onClick: (data: ClassificationItemData | undefined) => void; onSelectEvent: (event: Event) => void; children?: (data: ClassificationItemData) => React.ReactNode; @@ -143,6 +145,7 @@ export function GroupedClassificationCard({ threshold, selectedItems, i18nLibrary, + objectType, onClick, onSelectEvent, children, @@ -190,7 +193,7 @@ export function GroupedClassificationCard({
- {t("details.person")} + {getTranslatedLabel(objectType)} {event?.sub_label ? `: ${event.sub_label} (${Math.round((event.data.sub_label_score || 0) * 100)}%)` : ": " + t("details.unknown")} diff --git a/web/src/pages/FaceLibrary.tsx b/web/src/pages/FaceLibrary.tsx index 020b3b664..fc8e73e3f 100644 --- a/web/src/pages/FaceLibrary.tsx +++ b/web/src/pages/FaceLibrary.tsx @@ -865,6 +865,7 @@ function FaceAttemptGroup({ threshold={threshold} selectedItems={selectedFaces} i18nLibrary="views/faceLibrary" + objectType="person" onClick={(data) => { if (data) { onClickFaces([data.filename], true); diff --git a/web/src/views/classification/ModelTrainingView.tsx b/web/src/views/classification/ModelTrainingView.tsx index c23bf8e39..391bc90d7 100644 --- a/web/src/views/classification/ModelTrainingView.tsx +++ b/web/src/views/classification/ModelTrainingView.tsx @@ -700,7 +700,7 @@ function TrainGrid({ filepath: `clips/${model.name}/train/${raw}`, timestamp: Number.parseFloat(parts[2]), eventId: `${parts[0]}-${parts[1]}`, - name: parts[1], + name: parts[3], score: rawScore, }; }) @@ -961,6 +961,7 @@ function ObjectTrainGrid({ threshold={threshold} selectedItems={selectedImages} i18nLibrary="views/classificationModel" + objectType={model.object_config?.objects?.at(0) ?? "Object"} onClick={(data) => { if (data) { onClickImages([data.filename], true);