mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
Fix color map
This commit is contained in:
parent
a7d43cc273
commit
a4e125d54a
@ -158,17 +158,13 @@ class ModelConfig(BaseModel):
|
|||||||
|
|
||||||
def create_colormap(self, enabled_labels: set[str]) -> None:
|
def create_colormap(self, enabled_labels: set[str]) -> None:
|
||||||
"""Get a list of colors for enabled labels that aren't attributes."""
|
"""Get a list of colors for enabled labels that aren't attributes."""
|
||||||
colors = generate_color_palette(
|
enabled_trackable_labels = list(
|
||||||
len(
|
filter(lambda label: label not in self._all_attributes, enabled_labels)
|
||||||
list(
|
|
||||||
filter(
|
|
||||||
lambda label: label not in self._all_attributes, enabled_labels
|
|
||||||
)
|
)
|
||||||
)
|
colors = generate_color_palette(len(enabled_trackable_labels))
|
||||||
)
|
self._colormap = {
|
||||||
)
|
label: color for label, color in zip(enabled_trackable_labels, colors)
|
||||||
|
}
|
||||||
self._colormap = {label: color for label, color in zip(enabled_labels, colors)}
|
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user