mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
exclude attributes from labels colormap
This commit is contained in:
parent
96453f17f8
commit
c7273580f4
@ -157,8 +157,16 @@ class ModelConfig(BaseModel):
|
||||
self._model_hash = file_hash.hexdigest()
|
||||
|
||||
def create_colormap(self, enabled_labels: set[str]) -> None:
|
||||
"""Get a list of colors for enabled labels."""
|
||||
colors = generate_color_palette(len(enabled_labels))
|
||||
"""Get a list of colors for enabled labels that aren't attributes."""
|
||||
colors = generate_color_palette(
|
||||
len(
|
||||
list(
|
||||
filter(
|
||||
lambda label: label not in self._all_attributes, enabled_labels
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
self._colormap = {label: color for label, color in zip(enabled_labels, colors)}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user