mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 22:25:24 +03:00
Update matplotlib to 3.9.x
The mpl.cm toplevel registration has been removed. https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#top-level-cmap-registration-and-access-functions-in-mpl-cm
This commit is contained in:
parent
188a7de467
commit
7d0ba3fd92
@ -4,7 +4,7 @@ Flask_Limiter == 3.7.*
|
||||
imutils == 0.5.*
|
||||
joserfc == 0.11.*
|
||||
markupsafe == 2.1.*
|
||||
matplotlib == 3.8.*
|
||||
matplotlib == 3.9.*
|
||||
mypy == 1.6.1
|
||||
numpy == 1.26.*
|
||||
onvif_zeep == 0.2.12
|
||||
|
||||
@ -1033,7 +1033,7 @@ class CameraConfig(FrigateBaseModel):
|
||||
def __init__(self, **config):
|
||||
# Set zone colors
|
||||
if "zones" in config:
|
||||
colors = plt.cm.get_cmap("tab10", len(config["zones"]))
|
||||
colors = plt.colormaps["tab10"].resampled(len(config["zones"]))
|
||||
config["zones"] = {
|
||||
name: {**z, "color": tuple(round(255 * c) for c in colors(idx)[:3])}
|
||||
for idx, (name, z) in enumerate(config["zones"].items())
|
||||
|
||||
@ -128,7 +128,7 @@ class ModelConfig(BaseModel):
|
||||
|
||||
def create_colormap(self, enabled_labels: set[str]) -> None:
|
||||
"""Get a list of colors for enabled labels."""
|
||||
cmap = plt.cm.get_cmap("tab10", len(enabled_labels))
|
||||
cmap = plt.colormaps["tab10"].resampled(len(enabled_labels))
|
||||
|
||||
for key, val in enumerate(enabled_labels):
|
||||
self._colormap[val] = tuple(int(round(255 * c)) for c in cmap(key)[:3])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user