Skip to content

Commit

Permalink
fix(#90): length check
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Jan 13, 2020
1 parent fda5048 commit 038a829
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stagesepx/classifier/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def get_stage_range(self) -> typing.List[typing.List[SingleClassifierResult]]:
cur = next_one
cur_index += 1

# issue #90
assert len(result) > 0, "video seems to only contain one stage"

last = self.data[-1]
if result[-1][-1] != last:
result.append(self.data[cur.frame_id - 1 : last.frame_id - 1 + 1])
Expand All @@ -165,7 +168,7 @@ def get_length(self) -> int:
return len(self.data)

def calc_changing_cost(
self
self,
) -> typing.Dict[str, typing.Tuple[SingleClassifierResult, SingleClassifierResult]]:
""" calc time cost between stages """
# add changing cost
Expand Down

0 comments on commit 038a829

Please sign in to comment.