Skip to content

Commit

Permalink
Catching InputDataError (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogenesAnalytics committed Feb 6, 2024
1 parent 13696ed commit 84b9308
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/frame_sampling/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,14 @@ def sample(
# create dir
sample_subdir.mkdir(parents=True, exist_ok=exist_ok)

try:
# get frame samples from single video
self._sample_single_video(video_path, sample_subdir)

except av.InvalidDataError as error:
# decide how to handle error
self._handle_exceptions(error, video_path)


class MinimalSampler(BaseSampler):
"""Simplest frame sampling strategy."""
Expand Down

0 comments on commit 84b9308

Please sign in to comment.