-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from snakers4/adamnsandle
Adamnsandle
- Loading branch information
Showing
12 changed files
with
136 additions
and
42 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
[project] | ||
name = "silero-vad" | ||
version = "5.1" | ||
authors = [ | ||
{name="Silero Team", email="[email protected]"}, | ||
] | ||
description = "Voice Activity Detector (VAD) by Silero" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
dependencies = [ | ||
"torch>=1.12.0", | ||
"torchaudio>=0.12.0", | ||
"onnxruntime>=1.18.0", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/snakers4/silero-vad" | ||
Issues = "https://github.com/snakers4/silero-vad/issues" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from importlib.metadata import version | ||
try: | ||
__version__ = version(__name__) | ||
except: | ||
pass | ||
|
||
from silero_vad.model import load_silero_vad | ||
from silero_vad.utils_vad import (get_speech_timestamps, | ||
save_audio, | ||
read_audio, | ||
VADIterator, | ||
collect_chunks) |
Empty file.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from .utils_vad import init_jit_model, OnnxWrapper | ||
import torch | ||
torch.set_num_threads(1) | ||
|
||
def load_silero_vad(onnx=False): | ||
model_name = 'silero_vad.onnx' if onnx else 'silero_vad.jit' | ||
package_path = "silero_vad.data" | ||
|
||
try: | ||
import importlib_resources as impresources | ||
model_file_path = str(impresources.files(package_path).joinpath(model_name)) | ||
except: | ||
from importlib import resources as impresources | ||
try: | ||
with impresources.path(package_path, model_name) as f: | ||
model_file_path = f | ||
except: | ||
model_file_path = str(impresources.files(package_path).joinpath(model_name)) | ||
|
||
if onnx: | ||
model = OnnxWrapper(model_file_path, force_onnx_cpu=True) | ||
else: | ||
model = init_jit_model(model_file_path) | ||
|
||
return model |
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