mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 06:40:22 +00:00
Compare commits
3 Commits
1c2bd5d419
...
cf8ee499f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf8ee499f9 | ||
|
|
f16f6f95b8 | ||
|
|
e373b8adc7 |
@ -21,6 +21,10 @@ class OpenAIClient(GenAIClient):
|
||||
|
||||
def _init_provider(self):
|
||||
"""Initialize the client."""
|
||||
if self.genai_config.base_url:
|
||||
return OpenAI(
|
||||
api_key=self.genai_config.api_key, base_url=self.genai_config.base_url
|
||||
)
|
||||
return OpenAI(api_key=self.genai_config.api_key)
|
||||
|
||||
def _send(self, prompt: str, images: list[bytes]) -> Optional[str]:
|
||||
|
||||
@ -127,9 +127,7 @@ export default function SearchThumbnail({
|
||||
.filter(
|
||||
(item) => item !== undefined && !item.includes("-verified"),
|
||||
)
|
||||
.map((text) =>
|
||||
t(text.replace(" ", "_").toLowerCase(), { ns: "objects" }),
|
||||
)
|
||||
.map((text) => t(text, { ns: "objects" }))
|
||||
.sort()
|
||||
.join(", ")
|
||||
.replaceAll("-verified", "")}
|
||||
|
||||
@ -248,7 +248,7 @@ function GeneralFilterButton({
|
||||
}
|
||||
|
||||
if (selectedLabels.length == 1) {
|
||||
return t(selectedLabels[0].replace(" ", "_").toLowerCase(), {
|
||||
return t(selectedLabels[0], {
|
||||
ns: "objects",
|
||||
});
|
||||
}
|
||||
@ -357,7 +357,7 @@ export function GeneralFilterContent({
|
||||
{allLabels.map((item) => (
|
||||
<FilterSwitch
|
||||
key={item}
|
||||
label={t(item.replace(" ", "_").toLowerCase(), { ns: "objects" })}
|
||||
label={t(item, { ns: "objects" })}
|
||||
isChecked={currentLabels?.includes(item) ?? false}
|
||||
onCheckedChange={(isChecked) => {
|
||||
if (isChecked) {
|
||||
|
||||
@ -419,7 +419,7 @@ export default function InputWithTags({
|
||||
? t("button.yes", { ns: "common" })
|
||||
: t("button.no", { ns: "common" });
|
||||
} else if (filterType === "labels") {
|
||||
return t((filterValues as string).replace(" ", "_").toLowerCase(), {
|
||||
return t(filterValues as string, {
|
||||
ns: "objects",
|
||||
});
|
||||
} else if (filterType === "search_type") {
|
||||
@ -809,7 +809,7 @@ export default function InputWithTags({
|
||||
>
|
||||
{t("filter.label." + filterType)}:{" "}
|
||||
{filterType === "labels"
|
||||
? t(value.replace(" ", "_").toLowerCase(), {
|
||||
? t(value, {
|
||||
ns: "objects",
|
||||
})
|
||||
: value.replaceAll("_", " ")}
|
||||
|
||||
@ -325,7 +325,7 @@ export default function ReviewDetailDialog({
|
||||
values={{
|
||||
objects: missingObjects
|
||||
.map((x) =>
|
||||
t(x.replace(" ", "_").toLowerCase(), {
|
||||
t(x, {
|
||||
ns: "objects",
|
||||
}),
|
||||
)
|
||||
|
||||
@ -690,7 +690,7 @@ function ObjectDetailsTab({
|
||||
<div className="text-sm text-primary/40">{t("details.label")}</div>
|
||||
<div className="flex flex-row items-center gap-2 text-sm capitalize">
|
||||
{getIconForLabel(search.label, "size-4 text-primary")}
|
||||
{t(search.label.replace(" ", "_").toLowerCase(), {
|
||||
{t(search.label, {
|
||||
ns: "objects",
|
||||
})}
|
||||
{search.sub_label && ` (${search.sub_label})`}
|
||||
@ -953,7 +953,7 @@ function ObjectDetailsTab({
|
||||
description={
|
||||
search.label
|
||||
? t("details.editSubLabel.desc", {
|
||||
label: t(search.label.replace(" ", "_").toLowerCase(), {
|
||||
label: t(search.label, {
|
||||
ns: "objects",
|
||||
}),
|
||||
})
|
||||
@ -970,7 +970,7 @@ function ObjectDetailsTab({
|
||||
description={
|
||||
search.label
|
||||
? t("details.editLPR.desc", {
|
||||
label: t(search.label.replace(" ", "_").toLowerCase(), {
|
||||
label: t(search.label, {
|
||||
ns: "objects",
|
||||
}),
|
||||
})
|
||||
|
||||
@ -448,7 +448,7 @@ export function ZoneObjectSelector({ camera }: ZoneObjectSelectorProps) {
|
||||
<SelectSeparator className="bg-secondary" />
|
||||
{allLabels.map((item) => (
|
||||
<SelectItem key={item} value={item}>
|
||||
{t(item.replace(" ", "_").toLowerCase(), { ns: "objects" })}
|
||||
{t(item, { ns: "objects" })}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
|
||||
@ -936,7 +936,7 @@ export function ZoneObjectSelector({
|
||||
className="w-full cursor-pointer capitalize text-primary"
|
||||
htmlFor={item}
|
||||
>
|
||||
{t(item.replace(" ", "_").toLowerCase(), { ns: "objects" })}
|
||||
{t(item, { ns: "objects" })}
|
||||
</Label>
|
||||
<Switch
|
||||
key={item}
|
||||
|
||||
@ -152,7 +152,7 @@ function ThumbnailRow({
|
||||
return (
|
||||
<div className="rounded-lg bg-background_alt p-2 md:px-4">
|
||||
<div className="flex flex-row items-center text-lg capitalize">
|
||||
{t(objectType.replace(" ", "_").toLowerCase(), { ns: "objects" })}
|
||||
{t(objectType, { ns: "objects" })}
|
||||
{searchResults && (
|
||||
<span className="ml-3 text-sm text-secondary-foreground">
|
||||
{t("trackedObjectsCount", {
|
||||
|
||||
@ -79,9 +79,7 @@ export default function CameraSettingsView({
|
||||
const alertsLabels = useMemo(() => {
|
||||
return cameraConfig?.review.alerts.labels
|
||||
? cameraConfig.review.alerts.labels
|
||||
.map((label) =>
|
||||
t(label.replace(" ", "_").toLowerCase(), { ns: "objects" }),
|
||||
)
|
||||
.map((label) => t(label, { ns: "objects" }))
|
||||
.join(", ")
|
||||
: "";
|
||||
}, [cameraConfig, t]);
|
||||
@ -89,9 +87,7 @@ export default function CameraSettingsView({
|
||||
const detectionsLabels = useMemo(() => {
|
||||
return cameraConfig?.review.detections.labels
|
||||
? cameraConfig.review.detections.labels
|
||||
.map((label) =>
|
||||
t(label.replace(" ", "_").toLowerCase(), { ns: "objects" }),
|
||||
)
|
||||
.map((label) => t(label, { ns: "objects" }))
|
||||
.join(", ")
|
||||
: "";
|
||||
}, [cameraConfig, t]);
|
||||
|
||||
@ -326,7 +326,9 @@ export default function ClassificationSettingsView({
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="w-20">
|
||||
{classificationSettings.search.model_size}
|
||||
{t(
|
||||
`classification.semanticSearch.modelSize.${classificationSettings.search.model_size}.title`,
|
||||
)}
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
@ -456,7 +458,9 @@ export default function ClassificationSettingsView({
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="w-20">
|
||||
{classificationSettings.face.model_size}
|
||||
{t(
|
||||
`classification.faceRecognition.modelSize.${classificationSettings.face.model_size}.title`,
|
||||
)}
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user