Spaces:
Sleeping
Sleeping
Update services/metrics_service.py
Browse files
services/metrics_service.py
CHANGED
@@ -1,11 +1,4 @@
|
|
1 |
def update_metrics(detected):
|
2 |
-
"""Update live metrics based on detected anomalies."""
|
3 |
if not detected:
|
4 |
-
return "
|
5 |
-
|
6 |
-
counts = {}
|
7 |
-
for _, label, _ in detected:
|
8 |
-
counts[label] = counts.get(label, 0) + 1
|
9 |
-
|
10 |
-
metrics_summary = ", ".join(f"{label}: {count}" for label, count in counts.items())
|
11 |
-
return metrics_summary
|
|
|
1 |
def update_metrics(detected):
|
|
|
2 |
if not detected:
|
3 |
+
return {"Detections": 0}
|
4 |
+
return {"Detections": len(detected)}
|
|
|
|
|
|
|
|
|
|
|
|