SuriRaja commited on
Commit
e544c79
·
1 Parent(s): 6b08eb8

Update services/metrics_service.py

Browse files
Files changed (1) hide show
  1. services/metrics_service.py +4 -5
services/metrics_service.py CHANGED
@@ -1,7 +1,6 @@
1
  def update_metrics(detected_boxes):
2
- num_anomalies = len(detected_boxes)
3
- metrics = {
4
- "anomalies_detected": num_anomalies,
5
- "anomalies": detected_boxes
6
  }
7
- return metrics
 
1
  def update_metrics(detected_boxes):
2
+ anomalies = detected_boxes if detected_boxes else []
3
+ return {
4
+ "anomalies": anomalies,
5
+ "total_detected": len(anomalies),
6
  }