Skip to content

Commit

Permalink
Fix extraction summary bug
Browse files Browse the repository at this point in the history
- if the video length is below one minute the summary now completes
- always assume that there is now at least an unfinished minute in the video
  • Loading branch information
Timozen committed Apr 10, 2024
1 parent cb1aec8 commit 9d50bf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jefapato/blinking/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def summarize(
partial_times_l = pd.to_datetime(partial_l["minute"], unit='m', errors="ignore")
partial_group_l = partial_l.groupby(partial_times_l.dt.minute)

i = 1
for i, row in enumerate(partial_group_l.count()["minute"], start=1):
statistics[f"Partial_Blinks_min{i:02d}_left"] = row
while i <= math.ceil(length_l_min):
Expand All @@ -141,9 +142,11 @@ def summarize(
partial_r["minute"] = partial_r["apex_frame_og"] / fps / 60
partial_times_r = pd.to_datetime(partial_r["minute"], unit='m', errors="ignore")
partial_group_r = partial_r.groupby(partial_times_r.dt.minute)


i = 1
for i, row in enumerate(partial_group_r.count()["minute"], start=1):
statistics[f"Partial_Blinks_min{i:02d}_right"] = row

while i <= math.ceil(length_r_min):
statistics[f"Partial_Blinks_min{i:02d}_right"] = 0
i += 1
Expand Down

0 comments on commit 9d50bf3

Please sign in to comment.