feat: 解决新版tf中ctc_decode后出现大量-1问题
This commit is contained in:
parent
05d97c1c83
commit
160f7f6eed
|
@ -347,7 +347,10 @@ class ModelSpeech(): # 语音模型类
|
|||
else:
|
||||
r1 = r[0][0].numpy()
|
||||
#tf.compat.v1.reset_default_graph()
|
||||
return r1[0]
|
||||
p = 0
|
||||
while p < len(r1[0])-1 and r1[0][p] != -1:
|
||||
p += 1
|
||||
return r1[0][0:p]
|
||||
|
||||
def RecognizeSpeech(self, wavsignal, fs):
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue