mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 11:07:41 +03:00
Add speed and rate metrics for custom classification models
This commit is contained in:
parent
be8ee068e2
commit
e65f0560e4
@ -89,11 +89,12 @@ class FrigateApp:
|
||||
self.log_queue: Queue = mp.Queue()
|
||||
self.camera_metrics: dict[str, CameraMetrics] = {}
|
||||
self.embeddings_metrics: DataProcessorMetrics | None = (
|
||||
DataProcessorMetrics()
|
||||
DataProcessorMetrics(config.classification.custom)
|
||||
if (
|
||||
config.semantic_search.enabled
|
||||
or config.lpr.enabled
|
||||
or config.face_recognition.enabled
|
||||
or len(config.classification.custom) > 0
|
||||
)
|
||||
else None
|
||||
)
|
||||
|
||||
@ -20,8 +20,10 @@ class DataProcessorMetrics:
|
||||
alpr_pps: Synchronized
|
||||
yolov9_lpr_speed: Synchronized
|
||||
yolov9_lpr_pps: Synchronized
|
||||
classification_speeds: dict[str, Synchronized]
|
||||
classification_cps: dict[str, Synchronized]
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, custom_classification_models: list[str]):
|
||||
self.image_embeddings_speed = mp.Value("d", 0.0)
|
||||
self.image_embeddings_eps = mp.Value("d", 0.0)
|
||||
self.text_embeddings_speed = mp.Value("d", 0.0)
|
||||
@ -33,6 +35,13 @@ class DataProcessorMetrics:
|
||||
self.yolov9_lpr_speed = mp.Value("d", 0.0)
|
||||
self.yolov9_lpr_pps = mp.Value("d", 0.0)
|
||||
|
||||
if custom_classification_models:
|
||||
self.classification_speeds = {}
|
||||
self.classification_cps = {}
|
||||
for key in custom_classification_models:
|
||||
self.classification_speeds[key] = mp.Value("d", 0.0)
|
||||
self.classification_cps[key] = mp.Value("d", 0.0)
|
||||
|
||||
|
||||
class DataProcessorModelRunner:
|
||||
def __init__(self, requestor, device: str = "CPU", model_size: str = "large"):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user