Skip to content

NVR with realtime local object detection for IP cameras

Reduce outliers in motion data to ensure consistent scaling (#10452)

Nicolas Mowen45a318dfed48
diff --git a/frigate/api/review.py b/frigate/api/review.py
index 937f7948d8..6c159c66fd 100644
--- a/frigate/api/review.py
+++ b/frigate/api/review.py
@@ -407,6 +407,8 @@ def motion_activity():
mean = df["motion"].mean()
std = df["motion"].std()
df["motion"] = (df["motion"] - mean) / std
+ outliers = df.quantile(0.999)["motion"]
+ df[df > outliers] = outliers
df["motion"] = (
(df["motion"] - df["motion"].min())
/ (df["motion"].max() - df["motion"].min())