Refactor detector and model management (#23995)

* Refactor detector and model management

* Fix model resolution field
This commit is contained in:
Nicolas Mowen
2026-09-12 07:30:04 -06:00
parent fd76eb6c6f
commit 8fe35ace3b
63 changed files with 2052 additions and 1152 deletions
@@ -13,6 +13,7 @@ import { cn } from "@/lib/utils";
import { useTranslation } from "react-i18next";
import { Event } from "@/types/event";
import { resolveZoneName } from "@/hooks/use-zone-friendly-name";
import { getPrimaryModel } from "@/utils/modelUtil";
// Use a small tolerance (10ms) for browsers with seek precision by-design issues
const TOLERANCE = 0.01;
@@ -178,7 +179,7 @@ export default function ObjectTrackOverlay({
const getObjectColor = useCallback(
(label: string, objectId: string) => {
const objectColor = config?.model?.colormap[label];
const objectColor = getPrimaryModel(config)?.colormap?.[label];
if (objectColor) {
const reversed = [...objectColor].reverse();
return `rgb(${reversed.join(",")})`;