Skip to content

Commit

Permalink
Update matplot usage
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed May 22, 2024
1 parent 8c0d056 commit 9828454
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frigate/detectors/detector_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from enum import Enum
from typing import Dict, Optional, Tuple

import matplotlib.pyplot as plt
import matplotlib.cm as plt
import requests
from pydantic import BaseModel, ConfigDict, Field
from pydantic.fields import PrivateAttr
Expand Down Expand Up @@ -128,7 +128,7 @@ def compute_model_hash(self) -> None:

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.ColormapRegistry.get("tab10", len(enabled_labels))

for key, val in enumerate(enabled_labels):
self._colormap[val] = tuple(int(round(255 * c)) for c in cmap(key)[:3])
Expand Down

0 comments on commit 9828454

Please sign in to comment.