Skip to content

Commit 8270967

Browse files
authored
UI Fixes (#17762)
* Fix handling of non existing cameras in groups * Update docs * Improve typing
1 parent 1abd3c6 commit 8270967

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

docs/docs/configuration/object_detectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ output_name: "{input_basename}"
882882
config:
883883
mean_values: [[0, 0, 0]]
884884
std_values: [[255, 255, 255]]
885-
quant_img_rgb2bgr: true
885+
quant_img_RGB2BGR: true
886886
```
887887

888888
Explanation of the paramters:

frigate/detectors/detection_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66

7-
from frigate.detectors.detector_config import ModelTypeEnum
7+
from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum
88

99
logger = logging.getLogger(__name__)
1010

@@ -14,7 +14,7 @@ class DetectionApi(ABC):
1414
supported_models: List[ModelTypeEnum]
1515

1616
@abstractmethod
17-
def __init__(self, detector_config):
17+
def __init__(self, detector_config: BaseDetectorConfig):
1818
self.detector_config = detector_config
1919
self.thresh = 0.5
2020
self.height = detector_config.model.height

web/src/components/filter/SearchFilterGroup.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export default function SearchFilterGroup({
6363
return;
6464
}
6565
const cameraConfig = config.cameras[camera];
66+
67+
if (!cameraConfig) {
68+
return;
69+
}
70+
6671
cameraConfig.objects.track.forEach((label) => {
6772
if (!config.model.all_attributes.includes(label)) {
6873
labels.add(label);
@@ -99,7 +104,13 @@ export default function SearchFilterGroup({
99104
if (camera == "birdseye") {
100105
return;
101106
}
107+
102108
const cameraConfig = config.cameras[camera];
109+
110+
if (!cameraConfig) {
111+
return;
112+
}
113+
103114
Object.entries(cameraConfig.zones).map(([name, _]) => {
104115
zones.add(name);
105116
});

web/src/views/search/SearchView.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ export default function SearchView({
107107
if (camera == "birdseye") {
108108
return;
109109
}
110+
110111
const cameraConfig = config.cameras[camera];
112+
113+
if (!cameraConfig) {
114+
return;
115+
}
116+
111117
cameraConfig.objects.track.forEach((label) => {
112118
labels.add(label);
113119
});
@@ -139,7 +145,13 @@ export default function SearchView({
139145
if (camera == "birdseye") {
140146
return;
141147
}
148+
142149
const cameraConfig = config.cameras[camera];
150+
151+
if (!cameraConfig) {
152+
return;
153+
}
154+
143155
Object.entries(cameraConfig.zones).map(([name, _]) => {
144156
zones.add(name);
145157
});

0 commit comments

Comments
 (0)