remove debug stats

This commit is contained in:
makaveli10
2024-02-08 14:04:52 +05:30
parent b2ad6478f5
commit 9a9972007e
-5
View File
@@ -10,9 +10,7 @@ import onnxruntime
class VoiceActivityDetection(): class VoiceActivityDetection():
def __init__(self, force_onnx_cpu=True): def __init__(self, force_onnx_cpu=True):
print("downloading ONNX model...")
path = self.download() path = self.download()
print("loading session")
opts = onnxruntime.SessionOptions() opts = onnxruntime.SessionOptions()
opts.log_severity_level = 3 opts.log_severity_level = 3
@@ -20,13 +18,11 @@ class VoiceActivityDetection():
opts.inter_op_num_threads = 1 opts.inter_op_num_threads = 1
opts.intra_op_num_threads = 1 opts.intra_op_num_threads = 1
print("loading onnx model")
if force_onnx_cpu and 'CPUExecutionProvider' in onnxruntime.get_available_providers(): if force_onnx_cpu and 'CPUExecutionProvider' in onnxruntime.get_available_providers():
self.session = onnxruntime.InferenceSession(path, providers=['CPUExecutionProvider'], sess_options=opts) self.session = onnxruntime.InferenceSession(path, providers=['CPUExecutionProvider'], sess_options=opts)
else: else:
self.session = onnxruntime.InferenceSession(path, providers=['CUDAExecutionProvider'], sess_options=opts) self.session = onnxruntime.InferenceSession(path, providers=['CUDAExecutionProvider'], sess_options=opts)
print("reset states")
self.reset_states() self.reset_states()
self.sample_rates = [8000, 16000] self.sample_rates = [8000, 16000]
@@ -110,7 +106,6 @@ class VoiceActivityDetection():
# Check if the model file already exists # Check if the model file already exists
if not os.path.exists(model_filename): if not os.path.exists(model_filename):
# If it doesn't exist, download the model using wget # If it doesn't exist, download the model using wget
print("Downloading VAD ONNX model...")
try: try:
subprocess.run(["wget", "-O", model_filename, model_url], check=True) subprocess.run(["wget", "-O", model_filename, model_url], check=True)
except subprocess.CalledProcessError: except subprocess.CalledProcessError: