fix list index out of range.
This commit is contained in:
parent
e20595753f
commit
b83b1f72cb
@ -485,7 +485,7 @@ class KeyWordSpotter(torch.nn.Module):
|
|||||||
# For streaming kws, the cur_hyps should be reset if the time of
|
# For streaming kws, the cur_hyps should be reset if the time of
|
||||||
# a possible keyword last over the max_frames value you set.
|
# a possible keyword last over the max_frames value you set.
|
||||||
# see this issue:https://github.com/duj12/kws_demo/issues/2
|
# see this issue:https://github.com/duj12/kws_demo/issues/2
|
||||||
if len(self.cur_hyps[0][0]) > 0:
|
if len(self.cur_hyps) > 0 and len(self.cur_hyps[0][0]) > 0:
|
||||||
keyword_may_start = int(self.cur_hyps[0][1][2][0]['frame'])
|
keyword_may_start = int(self.cur_hyps[0][1][2][0]['frame'])
|
||||||
if (self.total_frames - keyword_may_start) > self.max_frames:
|
if (self.total_frames - keyword_may_start) > self.max_frames:
|
||||||
self.reset()
|
self.reset()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user