From 37d40558b7510f8a08e476b9457b06ce2f7847fd Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 20 May 2025 17:47:05 -0500 Subject: [PATCH] Fixes (#18319) * Add Thai (still need to merge weblate) * Apply attribute logic to all label types * Fix area check --------- Co-authored-by: Nicolas Mowen --- frigate/track/tracked_object.py | 5 +++-- web/public/locales/en/common.json | 1 + web/src/hooks/use-date-locale.ts | 1 + web/src/lib/const.ts | 1 + web/src/pages/FaceLibrary.tsx | 4 +++- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frigate/track/tracked_object.py b/frigate/track/tracked_object.py index 49bc3dfac..6b604b0e9 100644 --- a/frigate/track/tracked_object.py +++ b/frigate/track/tracked_object.py @@ -650,8 +650,9 @@ class TrackedObjectAttribute: best_object_id = obj["id"] best_object_label = obj["label"] else: - if best_object_label == "car" and obj["label"] == "car": - # if multiple cars are overlapping with the same label then the label will not be assigned + if best_object_label == obj["label"]: + # if multiple objects of the same type are overlapping + # then the attribute will not be assigned return None elif object_area < best_object_area: # if a car and person are overlapping then assign the label to the smaller object (which should be the person) diff --git a/web/public/locales/en/common.json b/web/public/locales/en/common.json index 422e722ca..6f68a56af 100644 --- a/web/public/locales/en/common.json +++ b/web/public/locales/en/common.json @@ -162,6 +162,7 @@ "da": "Dansk (Danish)", "sk": "Slovenčina (Slovak)", "yue": "粵語 (Cantonese)", + "th": "ไทย (Thai)", "withSystem": { "label": "Use the system settings for language" } diff --git a/web/src/hooks/use-date-locale.ts b/web/src/hooks/use-date-locale.ts index 4e51448fa..d36c1dda5 100644 --- a/web/src/hooks/use-date-locale.ts +++ b/web/src/hooks/use-date-locale.ts @@ -33,6 +33,7 @@ const localeMap: Record Promise> = { sk: () => import("date-fns/locale/sk").then((module) => module.sk), "yue-Hant": () => import("date-fns/locale/zh-HK").then((module) => module.zhHK), + th: () => import("date-fns/locale/th").then((module) => module.th), }; export function useDateLocale(): Locale { diff --git a/web/src/lib/const.ts b/web/src/lib/const.ts index 0afd0979d..e860b4ab4 100644 --- a/web/src/lib/const.ts +++ b/web/src/lib/const.ts @@ -8,6 +8,7 @@ export const supportedLanguageKeys = [ "nb-NO", "zh-CN", "yue-Hant", + "th", "ru", "tr", "pl", diff --git a/web/src/pages/FaceLibrary.tsx b/web/src/pages/FaceLibrary.tsx index 387bf5a5f..c062066a4 100644 --- a/web/src/pages/FaceLibrary.tsx +++ b/web/src/pages/FaceLibrary.tsx @@ -901,7 +901,9 @@ function FaceAttempt({ } return imgRef.current.naturalWidth * imgRef.current.naturalHeight; - }, [imgRef]); + // only refresh when severity changes + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [imgRef.current]); // api calls