Skip to content

Commit

Permalink
Explicitly set dtype to reduce memory usage and fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Apr 29, 2024
1 parent 8c610be commit c08b78d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 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,8 @@ 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 c08b78d

Please sign in to comment.