From 5858eee1fe01bfa6e149b7df9eb3b60295341b6b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 29 Apr 2024 05:23:08 -0600 Subject: [PATCH] Explicitly set pandas dtype to reduce memory usage and fix warning (#11145) * Explicitly set dtype to reduce memory usage and fix warning * remove extra line --- frigate/api/review.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frigate/api/review.py b/frigate/api/review.py index fa1dee73c..855122989 100644 --- a/frigate/api/review.py +++ b/frigate/api/review.py @@ -440,6 +440,7 @@ def motion_activity(): # resample data using pandas to get activity on scaled basis df = pd.DataFrame(data, columns=["start_time", "motion", "camera"]) + df = df.astype(dtype={"motion": "float16"}) # set date as datetime index df["start_time"] = pd.to_datetime(df["start_time"], unit="s") @@ -517,6 +518,7 @@ def audio_activity(): # resample data using pandas to get activity on scaled basis df = pd.DataFrame(data, columns=["start_time", "audio"]) + df = df.astype(dtype={"audio": "float16"}) # set date as datetime index df["start_time"] = pd.to_datetime(df["start_time"], unit="s")