Created
January 14, 2021 07:12
-
-
Save snakers4/7fff3bdc2c4b7a11516df8af0402d6fd to your computer and use it in GitHub Desktop.
silero_vad_example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
torch.set_num_threads(1) | |
from pprint import pprint | |
model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad', | |
model='silero_vad', | |
force_reload=True) | |
(get_speech_ts, | |
_, read_audio, | |
_, _, _) = utils | |
files_dir = torch.hub.get_dir() + '/snakers4_silero-vad_master/files' | |
wav = read_audio(f'{files_dir}/en.wav') | |
# full audio | |
# get speech timestamps from full audio file | |
speech_timestamps = get_speech_ts(wav, model, | |
num_steps=4) | |
pprint(speech_timestamps) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment