mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-04-14 01:17:50 +02:00
Normalize motion data in chunks (#10497)
This commit is contained in:
parent
1983de6528
commit
4e7808ac0c
@ -390,9 +390,15 @@ def motion_activity():
|
|||||||
.apply(lambda x: max(x, key=abs, default=0.0))
|
.apply(lambda x: max(x, key=abs, default=0.0))
|
||||||
.fillna(0.0)
|
.fillna(0.0)
|
||||||
)
|
)
|
||||||
df["motion"] = (
|
|
||||||
(df["motion"] - df["motion"].min())
|
length = df.shape[0]
|
||||||
/ (df["motion"].max() - df["motion"].min())
|
chunk = int(60 * (60 / scale))
|
||||||
|
|
||||||
|
for i in range(0, length, chunk):
|
||||||
|
part = df.iloc[i : i + chunk]
|
||||||
|
df.iloc[i : i + chunk, 0] = (
|
||||||
|
(part["motion"] - part["motion"].min())
|
||||||
|
/ (part["motion"].max() - part["motion"].min())
|
||||||
* 100
|
* 100
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user