mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-19 23:08:08 +02:00
Disable detection by default (#16980)
* Enable detection by default * Migrate config to have detect enabled if it is not
This commit is contained in:
@@ -32,6 +32,7 @@ class StationaryConfig(FrigateBaseModel):
|
||||
|
||||
|
||||
class DetectConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Detection Enabled.")
|
||||
height: Optional[int] = Field(
|
||||
default=None, title="Height of the stream for the detect role."
|
||||
)
|
||||
@@ -41,7 +42,6 @@ class DetectConfig(FrigateBaseModel):
|
||||
fps: int = Field(
|
||||
default=5, title="Number of frames per second to process through detection."
|
||||
)
|
||||
enabled: bool = Field(default=True, title="Detection Enabled.")
|
||||
min_initialized: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Minimum number of consecutive hits for an object to be initialized by the tracker.",
|
||||
|
||||
@@ -300,6 +300,12 @@ def migrate_016_0(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any]
|
||||
"""Handle migrating frigate config to 0.16-0"""
|
||||
new_config = config.copy()
|
||||
|
||||
# migrate config that does not have detect -> enabled explicitly set to have it enabled
|
||||
if new_config.get("detect", {}).get("enabled") is None:
|
||||
detect_config = new_config.get("detect", {})
|
||||
detect_config["enabled"] = True
|
||||
new_config["detect"] = detect_config
|
||||
|
||||
for name, camera in config.get("cameras", {}).items():
|
||||
camera_config: dict[str, dict[str, any]] = camera.copy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user