Downloads · 30 days
0
FredrikKarlssonSpeech/swift-f0-onnx
swift-f0-onnx is a machine learning model from FredrikKarlssonSpeech. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as mit.
Re-hosted ONNX graph from lars76/swift-f0 (PyPI: swift-f0, v0.1.2), a fast STFT + 2D-CNN fundamental frequency (F0) detector. In the pitch-benchmark suite it beats CREPE on both speed and accuracy.
Downloads · 30 days
0
Access
Public
Updated Sep 7, 2026
Repo size
398 KB
Likes
0
Public
Click a slice to open those files.
.onnx398 KB · 99%
From the Hugging Face model README
Re-hosted ONNX graph from lars76/swift-f0 (PyPI: swift-f0,
v0.1.2), a fast STFT + 2D-CNN fundamental frequency (F0) detector. In the
pitch-benchmark suite it beats CREPE on both speed
and accuracy.
Upstream ships the model already exported to ONNX — swift_f0/model.onnx — and the Python
package is itself just a thin onnxruntime.InferenceSession wrapper (see swift_f0/core.py).
This is that exact graph, unmodified, re-hosted for direct download (e.g. by
superassp, an R package for acoustic phonetic analysis).
| File | Precision | Size |
|---|---|---|
onnx/model.onnx | fp32 | 398 KB |
input: "input_audio" float32 [1, audio_length] # raw 16kHz mono waveform, dynamic length
output: "pitch_hz" float32 [1, num_frames] # per-frame F0 estimate, Hz
output: "confidence" float32 [1, num_frames] # per-frame voicing confidence, 0-1
Framing (STFT: 1024-sample window, 256-sample hop, 384-sample symmetric padding) is done
inside the graph via an ONNX STFT op (opset ≥17) — unlike CREPE, you feed raw audio
directly, no manual windowing.
i timestamp: t[i] = (i * 256 + 127.5) / 16000 seconds.confidence > threshold (default 0.9) and fmin <= pitch_hz <= fmax.import numpy as np
import onnxruntime as ort
sess = ort.InferenceSession("onnx/model.onnx", providers=["CPUExecutionProvider"])
audio = np.zeros((1, 16000), dtype=np.float32) # replace with real 16kHz mono waveform
pitch_hz, confidence = sess.run(["pitch_hz", "confidence"], {"input_audio": audio})
voiced = (confidence[0] > 0.9) & (pitch_hz[0] >= 46.875) & (pitch_hz[0] <= 2093.75)
Unmodified upstream artifact — no conversion step performed, so no PyTorch-vs-ONNX drift check applies (there is no separate PyTorch checkpoint upstream; the ONNX graph is the shipped model). Confirmed to load and run under onnxruntime 1.24.x CPU EP with no unsupported ops.
MIT, inherited from upstream lars76/swift-f0 (© Lars Nieradzik). See LICENSE.