Skip to content

Questions using Silero with Microsoft.ML.OnnxRuntime #216

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

You must be logged in to vote

Hi,

After enough searching and playing around, I found that the inputs are "input", "h0", and "c0". What is h0 and c0?

You can just follow this wrapper logic in your code:

silero-vad/utils_vad.py

Lines 10 to 52 in 7c671a7

class OnnxWrapper():
def __init__(self, path):
import numpy as np
global np
import onnxruntime
self.session = onnxruntime.InferenceSession(path)
self.session.intra_op_num_threads = 1
self.session.inter_op_num_threads = 1
self.reset_states()
def reset_states(self):
self._h = np.zeros((2, 1, 64)).astype('float32')
self._c = np.zeros((2, 1, 64)).astype('float32')
def __call__(self, x

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@shrestha-pranita
Comment options

@kkppstudios
Comment options

@shrestha-pranita
Comment options

Answer selected by snakers4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants