mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-09 00:17:00 +01:00
Sub label sensors (#16218)
* Support mqtt sensors for logo attributes * Expose in api
This commit is contained in:
parent
1c3527f5c4
commit
9236898a9d
@ -157,6 +157,7 @@ def config(request: Request):
|
||||
config["plus"] = {"enabled": request.app.frigate_config.plus_api.is_active()}
|
||||
config["model"]["colormap"] = config_obj.model.colormap
|
||||
config["model"]["all_attributes"] = config_obj.model.all_attributes
|
||||
config["model"]["non_logo_attributes"] = config_obj.model.non_logo_attributes
|
||||
|
||||
# use merged labelamp
|
||||
for detector_config in config["detectors"].values():
|
||||
|
@ -103,7 +103,7 @@ class CameraActivityManager:
|
||||
|
||||
# run through each object and check what topics need to be updated
|
||||
for label in self.config.cameras[camera].objects.track:
|
||||
if label in self.config.model.all_attributes:
|
||||
if label in self.config.model.non_logo_attributes:
|
||||
continue
|
||||
|
||||
new_count = all_objects[label]
|
||||
|
@ -78,6 +78,10 @@ class ModelConfig(BaseModel):
|
||||
def colormap(self) -> Dict[int, Tuple[int, int, int]]:
|
||||
return self._colormap
|
||||
|
||||
@property
|
||||
def non_logo_attributes(self) -> list[str]:
|
||||
return ["face", "license_plate"]
|
||||
|
||||
@property
|
||||
def all_attributes(self) -> list[str]:
|
||||
return self._all_attributes
|
||||
@ -107,7 +111,7 @@ class ModelConfig(BaseModel):
|
||||
|
||||
self._all_attributes = list(unique_attributes)
|
||||
self._all_attribute_logos = list(
|
||||
unique_attributes - set(["face", "license_plate"])
|
||||
unique_attributes - set(self.non_logo_attributes)
|
||||
)
|
||||
|
||||
def check_and_load_plus_model(
|
||||
|
Loading…
Reference in New Issue
Block a user