Compare commits

...

6 Commits

Author SHA1 Message Date
Josh Hawkins
6f58810579 add i18n for all presets 2026-03-25 10:42:51 -05:00
Josh Hawkins
dd80cca729 use i18n enum prefix for timestamp position 2026-03-25 10:26:05 -05:00
Josh Hawkins
5f61c54efd add optional i18n prefix for select widgets 2026-03-25 10:24:48 -05:00
Josh Hawkins
e7609afb54 don't require restart for timestamp_style changes 2026-03-25 10:12:53 -05:00
Josh Hawkins
c0f9b47e5c tweak wording 2026-03-25 10:08:20 -05:00
Josh Hawkins
f8b18dbd61 update classification docs 2026-03-25 09:57:26 -05:00
9 changed files with 66 additions and 8 deletions

View File

@ -102,8 +102,19 @@ If examples for some of your classes do not appear in the grid, you can continue
### Improving the Model ### Improving the Model
:::tip Diversity matters far more than volume
Selecting dozens of nearly identical images is one of the fastest ways to degrade model performance. MobileNetV2 can overfit quickly when trained on homogeneous data — the model learns what *that exact moment* looked like rather than what actually defines the class. **This is why Frigate does not implement bulk training in the UI.**
For more detail, see [Frigate Tip: Best Practices for Training Face and Custom Classification Models](https://github.com/blakeblackshear/frigate/discussions/21374).
:::
- **Start small and iterate**: Begin with a small, representative set of images per class. Models often begin working well with surprisingly few examples and improve naturally over time.
- **Favor hard examples**: When images appear in the Recent Classifications tab, prioritize images scoring below 90100% or those captured under new lighting, weather, or distance conditions.
- **Avoid bulk training similar images**: Training large batches of images that already score 100% (or close) adds little new information and increases the risk of overfitting.
- **The wizard is just the starting point**: You dont need to find and label every class upfront. Missing classes will naturally appear in Recent Classifications, and those images tend to be more valuable because they represent new conditions and edge cases.
- **Problem framing**: Keep classes visually distinct and relevant to the chosen object types. - **Problem framing**: Keep classes visually distinct and relevant to the chosen object types.
- **Data collection**: Use the models Recent Classification tab to gather balanced examples across times of day, weather, and distances.
- **Preprocessing**: Ensure examples reflect object crops similar to Frigates boxes; keep the subject centered. - **Preprocessing**: Ensure examples reflect object crops similar to Frigates boxes; keep the subject centered.
- **Labels**: Keep label names short and consistent; include a `none` class if you plan to ignore uncertain predictions for sub labels. - **Labels**: Keep label names short and consistent; include a `none` class if you plan to ignore uncertain predictions for sub labels.
- **Threshold**: Tune `threshold` per model to reduce false assignments. Start at `0.8` and adjust based on validation. - **Threshold**: Tune `threshold` per model to reduce false assignments. Start at `0.8` and adjust based on validation.

View File

@ -70,10 +70,21 @@ Once some images are assigned, training will begin automatically.
### Improving the Model ### Improving the Model
:::tip Diversity matters far more than volume
Selecting dozens of nearly identical images is one of the fastest ways to degrade model performance. MobileNetV2 can overfit quickly when trained on homogeneous data — the model learns what *that exact moment* looked like rather than what actually defines the state. This often leads to models that work perfectly under the original conditions but become unstable when day turns to night, weather changes, or seasonal lighting shifts. **This is why Frigate does not implement bulk training in the UI.**
For more detail, see [Frigate Tip: Best Practices for Training Face and Custom Classification Models](https://github.com/blakeblackshear/frigate/discussions/21374).
:::
- **Start small and iterate**: Begin with a small, representative set of images per class. Models often begin working well with surprisingly few examples and improve naturally over time.
- **Problem framing**: Keep classes visually distinct and state-focused (e.g., `open`, `closed`, `unknown`). Avoid combining object identity with state in a single model unless necessary. - **Problem framing**: Keep classes visually distinct and state-focused (e.g., `open`, `closed`, `unknown`). Avoid combining object identity with state in a single model unless necessary.
- **Data collection**: Use the model's Recent Classifications tab to gather balanced examples across times of day and weather. - **Data collection**: Use the model's Recent Classifications tab to gather balanced examples across times of day and weather.
- **When to train**: Focus on cases where the model is entirely incorrect or flips between states when it should not. There's no need to train additional images when the model is already working consistently. - **When to train**: Focus on cases where the model is entirely incorrect or flips between states when it should not. There's no need to train additional images when the model is already working consistently.
- **Selecting training images**: Images scoring below 100% due to new conditions (e.g., first snow of the year, seasonal changes) or variations (e.g., objects temporarily in view, insects at night) are good candidates for training, as they represent scenarios different from the default state. Training these lower-scoring images that differ from existing training data helps prevent overfitting. Avoid training large quantities of images that look very similar, especially if they already score 100% as this can lead to overfitting. - **Favor hard examples**: When images appear in the Recent Classifications tab, prioritize images scoring below 90100% or those captured under new conditions (e.g., first snow of the year, seasonal changes, objects temporarily in view, insects at night). These represent scenarios different from the default state and help prevent overfitting.
- **Avoid bulk training similar images**: Training large batches of images that already score 100% (or close) adds little new information and increases the risk of overfitting.
- **The wizard is just the starting point**: You don't need to find and label every state upfront. Missing states will naturally appear in Recent Classifications, and those images tend to be more valuable because they represent new conditions and edge cases.
## Debugging Classification Models ## Debugging Classification Models

View File

@ -32,6 +32,7 @@ class CameraConfigUpdateEnum(str, Enum):
face_recognition = "face_recognition" face_recognition = "face_recognition"
lpr = "lpr" lpr = "lpr"
snapshots = "snapshots" snapshots = "snapshots"
timestamp_style = "timestamp_style"
zones = "zones" zones = "zones"
@ -133,6 +134,8 @@ class CameraConfigUpdateSubscriber:
config.snapshots = updated_config config.snapshots = updated_config
elif update_type == CameraConfigUpdateEnum.onvif: elif update_type == CameraConfigUpdateEnum.onvif:
config.onvif = updated_config config.onvif = updated_config
elif update_type == CameraConfigUpdateEnum.timestamp_style:
config.timestamp_style = updated_config
elif update_type == CameraConfigUpdateEnum.zones: elif update_type == CameraConfigUpdateEnum.zones:
config.zones = updated_config config.zones = updated_config

View File

@ -474,7 +474,7 @@ class FrigateConfig(FrigateBaseModel):
live: CameraLiveConfig = Field( live: CameraLiveConfig = Field(
default_factory=CameraLiveConfig, default_factory=CameraLiveConfig,
title="Live playback", title="Live playback",
description="Settings used by the Web UI to control live stream resolution and quality.", description="Settings to control the jsmpeg live stream resolution and quality. This does not affect restreamed cameras that use go2rtc for live view.",
) )
motion: Optional[MotionConfig] = Field( motion: Optional[MotionConfig] = Field(
default=None, default=None,

View File

@ -81,6 +81,7 @@ class TrackedObjectProcessor(threading.Thread):
CameraConfigUpdateEnum.motion, CameraConfigUpdateEnum.motion,
CameraConfigUpdateEnum.objects, CameraConfigUpdateEnum.objects,
CameraConfigUpdateEnum.remove, CameraConfigUpdateEnum.remove,
CameraConfigUpdateEnum.timestamp_style,
CameraConfigUpdateEnum.zones, CameraConfigUpdateEnum.zones,
], ],
) )

View File

@ -752,7 +752,7 @@
}, },
"live": { "live": {
"label": "Live playback", "label": "Live playback",
"description": "Settings used by the Web UI to control live stream resolution and quality.", "description": "Settings to control the jsmpeg live stream resolution and quality. This does not affect restreamed cameras that use go2rtc for live view.",
"streams": { "streams": {
"label": "Live stream names", "label": "Live stream names",
"description": "Mapping of configured stream names to restream/go2rtc names used for live playback." "description": "Mapping of configured stream names to restream/go2rtc names used for live playback."

View File

@ -825,6 +825,12 @@
"area": "Area" "area": "Area"
} }
}, },
"timestampPosition": {
"tl": "Top left",
"tr": "Top right",
"bl": "Bottom left",
"br": "Bottom right"
},
"users": { "users": {
"title": "Users", "title": "Users",
"management": { "management": {
@ -1342,7 +1348,22 @@
"preset-nvidia": "NVIDIA GPU", "preset-nvidia": "NVIDIA GPU",
"preset-jetson-h264": "NVIDIA Jetson (H.264)", "preset-jetson-h264": "NVIDIA Jetson (H.264)",
"preset-jetson-h265": "NVIDIA Jetson (H.265)", "preset-jetson-h265": "NVIDIA Jetson (H.265)",
"preset-rkmpp": "Rockchip RKMPP" "preset-rkmpp": "Rockchip RKMPP",
"preset-http-jpeg-generic": "HTTP JPEG (Generic)",
"preset-http-mjpeg-generic": "HTTP MJPEG (Generic)",
"preset-http-reolink": "HTTP - Reolink Cameras",
"preset-rtmp-generic": "RTMP (Generic)",
"preset-rtsp-generic": "RTSP (Generic)",
"preset-rtsp-restream": "RTSP - Restream from go2rtc",
"preset-rtsp-restream-low-latency": "RTSP - Restream from go2rtc (Low Latency)",
"preset-rtsp-udp": "RTSP - UDP",
"preset-rtsp-blue-iris": "RTSP - Blue Iris",
"preset-record-generic": "Record (Generic, no audio)",
"preset-record-generic-audio-copy": "Record (Generic + Copy Audio)",
"preset-record-generic-audio-aac": "Record (Generic + Audio to AAC)",
"preset-record-mjpeg": "Record - MJPEG Cameras",
"preset-record-jpeg": "Record - JPEG Cameras",
"preset-record-ubiquiti": "Record - Ubiquiti Cameras"
} }
}, },
"cameraInputs": { "cameraInputs": {

View File

@ -4,12 +4,13 @@ const timestampStyle: SectionConfigOverrides = {
base: { base: {
sectionDocs: "/configuration/reference", sectionDocs: "/configuration/reference",
restartRequired: [], restartRequired: [],
fieldOrder: ["position", "format", "color", "thickness"], fieldOrder: ["position", "format", "thickness", "color"],
hiddenFields: ["effect", "enabled_in_config"], hiddenFields: ["effect", "enabled_in_config"],
advancedFields: [], advancedFields: [],
uiSchema: { uiSchema: {
position: { position: {
"ui:size": "xs", "ui:size": "xs",
"ui:options": { enumI18nPrefix: "timestampPosition" },
}, },
format: { format: {
"ui:size": "xs", "ui:size": "xs",
@ -17,7 +18,7 @@ const timestampStyle: SectionConfigOverrides = {
}, },
}, },
global: { global: {
restartRequired: ["position", "format", "color", "thickness", "effect"], restartRequired: [],
}, },
camera: { camera: {
restartRequired: [], restartRequired: [],

View File

@ -1,5 +1,6 @@
// Select Widget - maps to shadcn/ui Select // Select Widget - maps to shadcn/ui Select
import type { WidgetProps } from "@rjsf/utils"; import type { WidgetProps } from "@rjsf/utils";
import { useTranslation } from "react-i18next";
import { import {
Select, Select,
SelectContent, SelectContent,
@ -21,9 +22,18 @@ export function SelectWidget(props: WidgetProps) {
schema, schema,
} = props; } = props;
const { t } = useTranslation(["views/settings"]);
const { enumOptions = [] } = options; const { enumOptions = [] } = options;
const enumI18nPrefix = options["enumI18nPrefix"] as string | undefined;
const fieldClassName = getSizedFieldClassName(options, "sm"); const fieldClassName = getSizedFieldClassName(options, "sm");
const getLabel = (option: { value: unknown; label: string }) => {
if (enumI18nPrefix) {
return t(`${enumI18nPrefix}.${option.value}`);
}
return option.label;
};
return ( return (
<Select <Select
value={value?.toString() ?? ""} value={value?.toString() ?? ""}
@ -42,7 +52,7 @@ export function SelectWidget(props: WidgetProps) {
<SelectContent> <SelectContent>
{enumOptions.map((option: { value: unknown; label: string }) => ( {enumOptions.map((option: { value: unknown; label: string }) => (
<SelectItem key={String(option.value)} value={String(option.value)}> <SelectItem key={String(option.value)} value={String(option.value)}>
{option.label} {getLabel(option)}
</SelectItem> </SelectItem>
))} ))}
</SelectContent> </SelectContent>