From 3515361320e2a65f7c2814dd236f63b56c6397db Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 11 Mar 2024 07:53:13 -0600 Subject: [PATCH] refactor motion calculation (#10380) * refactor motion calculation * Use float --- frigate/api/review.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frigate/api/review.py b/frigate/api/review.py index 4170a1a91..937f7948d 100644 --- a/frigate/api/review.py +++ b/frigate/api/review.py @@ -404,6 +404,9 @@ def motion_activity(): # normalize data df = df.resample(f"{scale}S").sum().fillna(0.0) + mean = df["motion"].mean() + std = df["motion"].std() + df["motion"] = (df["motion"] - mean) / std df["motion"] = ( (df["motion"] - df["motion"].min()) / (df["motion"].max() - df["motion"].min())