Skip to content

Commit

Permalink
Explicitly set pandas dtype to reduce memory usage and fix warning (b…
Browse files Browse the repository at this point in the history
…lakeblackshear#11145)

* Explicitly set dtype to reduce memory usage and fix warning

* remove extra line
  • Loading branch information
NickM-27 committed Apr 29, 2024
1 parent 90468c8 commit 5858eee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frigate/api/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5858eee

Please sign in to comment.