Skip to content

Commit

Permalink
Video QC: change log level from WARNING to INFO if less than 0.1% of …
Browse files Browse the repository at this point in the history
…frames have been dropped
  • Loading branch information
bimac committed Sep 19, 2024
1 parent 01e088a commit adc1ba0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
8.24.1
------
* change UI workflow for appending a session
* Video QC: changed log level from WARNING to INFO if less than 0.1% of frames have been dropped

8.24.0
------
Expand Down
4 changes: 2 additions & 2 deletions iblrig/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ def validate_video(video_path, config):
# Check frame data
count, gpio = load_embedded_frame_data(video_path.parents[1], label_from_path(video_path))
dropped = count[-1] - (meta.length - 1)
if dropped != 0: # Log ERROR if > .1% frames dropped, otherwise log WARN
if dropped != 0: # Log ERROR if > .1% frames dropped, otherwise log INFO
pct_dropped = dropped / (count[-1] + 1) * 100
level = 30 if pct_dropped < 0.1 else 40
level = logging.INFO if pct_dropped < 0.1 else logging.ERROR
log.log(level, 'Missed frames (%.2f%%) - frame data N = %i; video file N = %i', pct_dropped, count[-1] + 1, meta.length)
ok = False
if len(count) != meta.length:
Expand Down

0 comments on commit adc1ba0

Please sign in to comment.