Skip to content

Commit

Permalink
fix(data): clip_len为多帧时下标超过图像数目
Browse files Browse the repository at this point in the history
  • Loading branch information
zjykzj committed Oct 29, 2020
1 parent 61e3035 commit daf01a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tsn/data/datasets/clipsample/seg_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def _get_train_clips(self, num_frames):
np.ndarray: Sampled frame indices in train mode.
"""
one_clip_len = self.clip_len * self.frame_interval
avg_interval = (num_frames - one_clip_len + 1) // self.num_clips
# avg_interval = (num_frames - one_clip_len + 1) // self.num_clips
avg_interval = (num_frames - one_clip_len) // self.num_clips

if avg_interval > 0:
base_offsets = np.arange(self.num_clips) * avg_interval
Expand Down

0 comments on commit daf01a8

Please sign in to comment.