Skip to content

Commit

Permalink
Assure that frame indices for label calculation are at least one inte…
Browse files Browse the repository at this point in the history
…ger apart
  • Loading branch information
shelm committed Jun 22, 2023
1 parent d603b0c commit 5d840b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hcai_datasets/hcai_nova_dynamic/utils/nova_anno_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ def get_label_for_frame(self, start, end):
s = int(start * self.sr / 1000)
e = int(end * self.sr / 1000)

# Assure that indices for array are at least one integer apart
if s == e:
e = s + 1

if len(self.data) >= e:
frame = self.data[s:e]
frame_data = frame[:, 0]
Expand Down

0 comments on commit 5d840b2

Please sign in to comment.