Skip to content

VAD probability very low using ONNX on Android #284

Answered by snakers4
lhr0909 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

I cannot really comment on the language used for Android, but looks like your code is not stateful. I.e. the VAD should keep the state during the session. With ONNX the best illustration is here:

silero-vad/utils_vad.py

Lines 63 to 68 in e7c4539

if sr in [8000, 16000]:
ort_inputs = {'input': x.numpy(), 'h': self._h, 'c': self._c, 'sr': np.array(sr, dtype='int64')}
ort_outs = self.session.run(None, ort_inputs)
out, self._h, self._c = ort_outs
else:
raise ValueError()

Looks like you always re-create these tensors:

https://github.com/lhr0909/live-subtitles-rokid-ar/blob/f19ecc197d3bee6484fa7145f73607bb90d77869/app/src/main/java/chat/senses/lives…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@lhr0909
Comment options

@snakers4
Comment options

@lhr0909
Comment options

@snakers4
Comment options

Answer selected by lhr0909
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants