Skip to content

Commit

Permalink
fix(#133): hook should always be applied in all the frames
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Aug 6, 2020
1 parent 2d28a63 commit 3184a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stagesepx/classifier/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ def classify(
# for boost
prev_result: typing.Optional[str] = None
while frame is not None:
# hook
frame = self._apply_hook(frame, *args, **kwargs)
# ignore some ranges
if limit_range and not any(
[each.contain(frame.frame_id) for each in limit_range]
Expand All @@ -435,8 +437,6 @@ def classify(
result = prev_result
# else, do the real job
else:
# hook
frame = self._apply_hook(frame, *args, **kwargs)
prev_result = result = self._classify_frame(frame, *args, **kwargs)
logger.debug(
f"frame {frame.frame_id} ({frame.timestamp}) belongs to {result}"
Expand Down

0 comments on commit 3184a0e

Please sign in to comment.