Skip to content

Commit

Permalink
Update database.py
Browse files Browse the repository at this point in the history
Fixes #3.
  • Loading branch information
kwatcharasupat authored May 12, 2022
1 parent cf59e4b commit 3c03140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataset/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get_segment_idxes(self, n_frames: int, downsample_ratio: int, pointer: int):
pointer + n_crop_frames - self.chunk_len // downsample_ratio + 1,
self.chunk_hop_len // downsample_ratio).tolist()
# Include the leftover of the cropped data
if (n_crop_frames - self.chunk_len // downsample_ratio) % self.chunk_hop_len // downsample_ratio != 0:
if (n_crop_frames - self.chunk_len // downsample_ratio) % (self.chunk_hop_len // downsample_ratio) != 0:
idxes.append(pointer + n_crop_frames - self.chunk_len // downsample_ratio)
pointer += n_crop_frames

Expand Down Expand Up @@ -307,4 +307,4 @@ def load_classwise_gt(self, gt_meta_fn, n_frames):
print(db_data['doa_targets'].shape)
print(len(db_data['feature_chunk_idxes']))
print(len(db_data['gt_chunk_idxes']))
print(len(db_data['filename_list']))
print(len(db_data['filename_list']))

0 comments on commit 3c03140

Please sign in to comment.