mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Explicitly set dtype to reduce memory usage and fix warning
This commit is contained in:
parent
8c610bea49
commit
c08b78d5eb
@ -440,6 +440,7 @@ def motion_activity():
|
|||||||
|
|
||||||
# resample data using pandas to get activity on scaled basis
|
# resample data using pandas to get activity on scaled basis
|
||||||
df = pd.DataFrame(data, columns=["start_time", "motion", "camera"])
|
df = pd.DataFrame(data, columns=["start_time", "motion", "camera"])
|
||||||
|
df = df.astype(dtype={"motion": "float16"})
|
||||||
|
|
||||||
# set date as datetime index
|
# set date as datetime index
|
||||||
df["start_time"] = pd.to_datetime(df["start_time"], unit="s")
|
df["start_time"] = pd.to_datetime(df["start_time"], unit="s")
|
||||||
@ -517,6 +518,8 @@ def audio_activity():
|
|||||||
|
|
||||||
# resample data using pandas to get activity on scaled basis
|
# resample data using pandas to get activity on scaled basis
|
||||||
df = pd.DataFrame(data, columns=["start_time", "audio"])
|
df = pd.DataFrame(data, columns=["start_time", "audio"])
|
||||||
|
df = df.astype(dtype={"audio": "float16"})
|
||||||
|
|
||||||
|
|
||||||
# set date as datetime index
|
# set date as datetime index
|
||||||
df["start_time"] = pd.to_datetime(df["start_time"], unit="s")
|
df["start_time"] = pd.to_datetime(df["start_time"], unit="s")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user