mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
initial 3.0 commit
This commit is contained in:
88
hubconf.py
88
hubconf.py
@@ -2,15 +2,13 @@ dependencies = ['torch', 'torchaudio']
|
||||
import torch
|
||||
import json
|
||||
from utils_vad import (init_jit_model,
|
||||
get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
get_speech_timestamps,
|
||||
get_number_ts,
|
||||
get_language,
|
||||
get_language_and_group,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
VADIterator,
|
||||
collect_chunks,
|
||||
drop_chunks)
|
||||
|
||||
@@ -21,85 +19,11 @@ def silero_vad(**kwargs):
|
||||
Please see https://github.com/snakers4/silero-vad for usage examples
|
||||
"""
|
||||
hub_dir = torch.hub.get_dir()
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/model.jit')
|
||||
utils = (get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/Silero_VAD.jit')
|
||||
utils = (get_speech_timestamps,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
collect_chunks)
|
||||
|
||||
return model, utils
|
||||
|
||||
|
||||
def silero_vad_micro(**kwargs):
|
||||
"""Silero Voice Activity Detector
|
||||
Returns a model with a set of utils
|
||||
Please see https://github.com/snakers4/silero-vad for usage examples
|
||||
"""
|
||||
hub_dir = torch.hub.get_dir()
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/model_micro.jit')
|
||||
utils = (get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
collect_chunks)
|
||||
|
||||
return model, utils
|
||||
|
||||
|
||||
def silero_vad_micro_8k(**kwargs):
|
||||
"""Silero Voice Activity Detector
|
||||
Returns a model with a set of utils
|
||||
Please see https://github.com/snakers4/silero-vad for usage examples
|
||||
"""
|
||||
hub_dir = torch.hub.get_dir()
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/model_micro_8k.jit')
|
||||
utils = (get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
collect_chunks)
|
||||
|
||||
return model, utils
|
||||
|
||||
|
||||
def silero_vad_mini(**kwargs):
|
||||
"""Silero Voice Activity Detector
|
||||
Returns a model with a set of utils
|
||||
Please see https://github.com/snakers4/silero-vad for usage examples
|
||||
"""
|
||||
hub_dir = torch.hub.get_dir()
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/model_mini.jit')
|
||||
utils = (get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
collect_chunks)
|
||||
|
||||
return model, utils
|
||||
|
||||
|
||||
def silero_vad_mini_8k(**kwargs):
|
||||
"""Silero Voice Activity Detector
|
||||
Returns a model with a set of utils
|
||||
Please see https://github.com/snakers4/silero-vad for usage examples
|
||||
"""
|
||||
hub_dir = torch.hub.get_dir()
|
||||
model = init_jit_model(model_path=f'{hub_dir}/snakers4_silero-vad_master/files/model_mini_8k.jit')
|
||||
utils = (get_speech_ts,
|
||||
get_speech_ts_adaptive,
|
||||
save_audio,
|
||||
read_audio,
|
||||
state_generator,
|
||||
single_audio_stream,
|
||||
VADIterator,
|
||||
collect_chunks)
|
||||
|
||||
return model, utils
|
||||
@@ -151,4 +75,4 @@ def silero_lang_detector_95(**kwargs):
|
||||
|
||||
utils = (get_language_and_group, read_audio)
|
||||
|
||||
return model, lang_dict, lang_group_dict, utils
|
||||
return model, lang_dict, lang_group_dict, utils
|
||||
|
||||
Reference in New Issue
Block a user