YAMNet, ONNX
Google's YAMNet (521 AudioSet classes, MobileNetV1, 3.7 M parameters) converted to ONNX. Used by myDubber to tell speech from everything else a voice track may hold: a turn it doesn't hear as speech (a song playing in a stream, singing) is left in the original instead of being dubbed.
Built from the TensorFlow 2 SavedModel google/yamnet version 1 (archive sha256 b80da2a1a56926fb0767205051a200dd7b3beaf3ea1ea126c42a53943996e5e0) by
model_builds/yamnet.py
(dubber): python -m tf2onnx.convert --saved-model … --opset 15 (tensorflow==2.15.1, tf2onnx==1.16.1). The format is
changed, the weights are not: nothing was trained, quantized or pruned; the scores match the SavedModel's within
0.001 on the build's check. yamnet_class_map.csv is the SavedModel's own.
import numpy as np, onnxruntime as ort
session = ort.InferenceSession("yamnet.onnx")
waveform = np.zeros(16000 * 3, dtype=np.float32) # 16 kHz mono in [-1, 1], any length
scores = session.run(None, {session.get_inputs()[0].name: waveform})[0] # (frames, 521): 0.96 s every 0.48 s
speech = scores[:, 0].mean()
yamnet.onnx: 15.3 MB, sha256 844ee869ca5426d12c6aa1876280c40099487bda74827da1ccbeeaffbe7143dd
Licence
Apache-2.0, as the original (copy in LICENSE). Copyright of the model: Google LLC. The AudioSet ontology and its
class names are Google's, under CC BY 4.0.