mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-27 03:18:59 +03:00
Migrate Hailo detector key and support hailo device (#24327)
* Migrate Hailo detector key and support hailo device * Fix missing check
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from "@/components/ui/select";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import type { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { describeSupportedDetectors } from "@/utils/plusModels";
|
||||
|
||||
export type FrigatePlusModel = {
|
||||
id: string;
|
||||
@@ -20,6 +21,8 @@ export type FrigatePlusModel = {
|
||||
trainDate: string;
|
||||
isBaseModel: boolean;
|
||||
supportedDetectors: string[];
|
||||
// which Hailo device a Hailo model was built for, absent on every other model
|
||||
hailoDevice?: string;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
@@ -152,7 +155,7 @@ export function ModelSourcePicker({
|
||||
<div>{describe(model)}</div>
|
||||
<div className="text-xs text-muted-foreground">
|
||||
{t("frigatePlus.modelInfo.supportedDetectors")}:{" "}
|
||||
{model.supportedDetectors.join(", ")}
|
||||
{describeSupportedDetectors(model)}
|
||||
</div>
|
||||
</SelectItem>
|
||||
))
|
||||
|
||||
@@ -429,6 +429,8 @@ export type DetectionModelConfig = {
|
||||
baseModel: string;
|
||||
isBaseModel: boolean;
|
||||
supportedDetectors: string[];
|
||||
// which Hailo device a Hailo model was built for, absent on every other model
|
||||
hailoDevice?: string;
|
||||
width: number;
|
||||
height: number;
|
||||
} | null;
|
||||
|
||||
@@ -55,7 +55,7 @@ export function runnerNames(models: DetectionModelConfig[]): string[] {
|
||||
export const PROBED_DETECTORS = new Set([
|
||||
"cpu",
|
||||
"edgetpu",
|
||||
"hailo8l",
|
||||
"hailo",
|
||||
"memryx",
|
||||
"openvino",
|
||||
"onnx",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/** Matching Frigate+ models against the hardware that can run them. */
|
||||
|
||||
type PlusModel = {
|
||||
supportedDetectors: string[];
|
||||
// which Hailo device a Hailo model was built for, absent on every other model
|
||||
hailoDevice?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The detectors to show for a model.
|
||||
*
|
||||
* Every Hailo model supports the one hailo detector, so the device it was
|
||||
* built for is what the user needs to see.
|
||||
*/
|
||||
export function describeSupportedDetectors(model: PlusModel): string {
|
||||
return model.hailoDevice ?? model.supportedDetectors.join(", ");
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from "@/components/card/SettingsGroupCard";
|
||||
import type { DetectionModelConfig } from "@/types/frigateConfig";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { describeSupportedDetectors } from "@/utils/plusModels";
|
||||
|
||||
type FrigatePlusCurrentModelSummaryProps = {
|
||||
plusModel: DetectionModelConfig["plus"];
|
||||
@@ -61,7 +62,7 @@ export default function FrigatePlusCurrentModelSummary({
|
||||
/>
|
||||
<SplitCardRow
|
||||
label={t("frigatePlus.modelInfo.supportedDetectors")}
|
||||
content={<p>{plusModel.supportedDetectors.join(", ")}</p>}
|
||||
content={<p>{describeSupportedDetectors(plusModel)}</p>}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user