Skip to content

Commit

Permalink
fix(#20): error when unstable range count equal or less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Aug 6, 2019
1 parent cd44b09 commit bb002bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions stagesepx/cutter/cut_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def get_unstable_range(self,
[i for i in self.ssim_list if not i.is_stable(**kwargs)],
key=lambda x: x.start)

# video can be totally stable ( nothing changed )
# or only one unstable range
if len(change_range_list) <= 1:
return change_range_list

# merge
i = 0
merged_change_range_list = list()
Expand Down
8 changes: 0 additions & 8 deletions stagesepx/cutter/cutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ def convert_video_into_ssim_list(self, video_path: str, block: int = None, **kwa
# compress
start = toolbox.compress_frame(start, **kwargs)

# split func
# width > height
if frame_size[0] > frame_size[1]:
split_func = np.hsplit
else:
split_func = np.vsplit
logger.debug(f'split function: {split_func.__name__}')

while ret:
end = toolbox.compress_frame(end, **kwargs)

Expand Down

0 comments on commit bb002bf

Please sign in to comment.