Implement UI for managing multiple models (#24023)

* Implement hardware detection and UI management

* Cleanup Frigate+ detection

* Don't count model as changed

* Fixes for audio map error

* Add descriptions

* Enforce that all model must exist

* Fix hardware picking

* Docs fixes

* WebUI cleanup

* Cleanup handling of scenes

* UI refinement

* Cleanup recommended UI

* test fixews
This commit is contained in:
Nicolas Mowen
2026-09-12 07:30:04 -06:00
parent 3f20209339
commit 27a40a507b
59 changed files with 2554 additions and 2587 deletions
+23 -2
View File
@@ -159,7 +159,7 @@ class TestConfig(unittest.TestCase):
FrigateConfig(**(deep_merge(config, self.minimal)))
@patch("frigate.detectors.detector_config.load_labels")
def test_camera_scene_must_match_a_model(self, mock_labels):
def test_camera_scene_without_a_model_falls_back_to_all(self, mock_labels):
mock_labels.return_value = {}
config = {
"models": [{"devices": ["cpu"]}],
@@ -175,6 +175,27 @@ class TestConfig(unittest.TestCase):
},
}
frigate_config = FrigateConfig(**(deep_merge(config, self.minimal)))
assert frigate_config.model_for_camera("back").scene == SceneEnum.all
@patch("frigate.detectors.detector_config.load_labels")
def test_camera_scene_without_a_model_or_a_default(self, mock_labels):
mock_labels.return_value = {}
config = {
"models": [{"scene": "indoor", "devices": ["cpu"]}],
"cameras": {
"back": {
"detect": {"scene": "outdoor"},
"ffmpeg": {
"inputs": [
{"path": "rtsp://10.0.0.1:554/video", "roles": ["detect"]},
]
},
},
},
}
with self.assertRaises(ValidationError):
FrigateConfig(**(deep_merge(config, self.minimal)))
@@ -1298,7 +1319,7 @@ class TestConfig(unittest.TestCase):
70: "dogs",
75: "dogs",
}
assert frigate_config.model.merged_labelmap[69] != "dogs"
assert frigate_config.primary_model.merged_labelmap[69] != "dogs"
def test_default_labelmap_empty(self):
config = {