Skip to content
Projets

À propos

A lightweight Python package for Automatic Speech Recognition using ONNX models

IA et apprentissage automatique

Comment ces chiffres sont mesurés

What you can do

  • NeMo: Parakeet v2 (En) / v3 (Multilingual), Canary v1/v2 (Multilingual)
  • GigaAM: GigaAM v2/v3/v4 (Ru), GigaAM Multilingual v1/v2
  • Community Parakeet adaptations: Orukeet and Fluid Speech Pro

Progression mesurée des étoiles

in 24h
0
in 7 days
+4
in 15 days
+3
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

ONNX ASR

PyPI - Version PyPI - Downloads PyPI - Python Version PyPI - Types PyPI - License
uv Ruff mypy Zensical CodeFactor Grade Codecov GitHub - CI

onnx-asr is a Python package for Automatic Speech Recognition using ONNX models. It's a lightweight, fast, and easy-to-use pure Python package with minimal dependencies (no need for PyTorch, Transformers, or FFmpeg):

numpy onnxruntime huggingface-hub

Key features of onnx-asr include:

  • Supports many modern ASR models
  • Runs on a wide range of devices, from small IoT/edge devices to servers with powerful GPUs (benchmarks)
  • Runs on x86 and Arm systems with Windows, Linux, or macOS
  • Supports hardware acceleration via CUDA/TensorRT, CoreML/MLX, ROCm/MIGraphX, OpenVINO, DirectML, and WebGPU
  • Supports NumPy 1.23.5 through 2.x and Python 3.11–3.14
  • Loads models from Hugging Face or local directories, including quantized versions
  • Accepts PCM WAV files or NumPy arrays, with built-in file reading and resampling
  • Supports custom models (see the Conversion Guide for instructions)
  • Supports batch processing
  • Supports long-form recognition using VAD (Voice Activity Detection)
  • Can return token-level timestamps and log probabilities
  • Provides a fully typed and well-documented Python API
  • Provides a simple command-line interface (CLI)

Model Highlights

[!TIP] Try the onnx-asr demo on Hugging Face Spaces:

Open in Spaces

Quick Start

Install onnx-asr for CPU inference with Hugging Face model downloads:

pip install "onnx-asr[cpu,hub]"

Load a model and recognize a PCM WAV file:

import onnx_asr

# Load the Parakeet TDT v3 model from Hugging Face (may take a few minutes)
model = onnx_asr.load_model("nemo-parakeet-tdt-0.6b-v3")

# Recognize speech and print the result
print(model.recognize("test.wav"))

[!WARNING] Most models comfortably handle 20–30-second audio segments; longer inputs depend on the model and available memory. For long recordings, use VAD. See audio length guidelines for details.

For more examples, see the Usage Guide.

See the Installation Guide for more installation options and system requirements. For GPU setup, see Hardware Acceleration.

Supported Model Architectures

The package supports the following modern ASR model architectures. See supported model names for a complete list and the model comparison for comparisons with the original implementations.

  • NVIDIA NeMo QuartzNet/Jasper/Conformer/FastConformer/Parakeet/Canary (with CTC, RNN-T, TDT, and Transformer decoders)
  • GigaChat GigaAM v2/v3/v4 and Multilingual v1/v2 (with CTC and RNN-T decoders, including E2E versions)
  • Kaldi Icefall Zipformer (with a stateless RNN-T decoder), including Alpha Cephei Vosk 0.52+
  • T-Tech T-one (with a CTC decoder; streaming is not yet supported)
  • Hugging Face Wav2Vec2 / XLS-R (with a CTC decoder)
  • OpenAI Whisper

The package provides model-specific audio preprocessing and greedy decoding alongside ONNX inference.

Community Models

The Hugging Face community publishes additional onnx-asr-compatible language fine-tunes, model families, and optimized exports, including integrations from model authors. See the curated community models or browse all models tagged onnx-asr. Community models are maintained by their publishers and may not be tested by this project.

Benchmarks

Inverse Real-Time Factor (RTFx) is the ratio of audio duration to processing time. An RTFx greater than 1 indicates faster-than-real-time processing; higher values indicate better performance.

Model 9800X3D CPU (RTFx) Cortex A53 CPU (RTFx) T4 CUDA (RTFx) RTX 5070 Ti TensorRT (RTFx)
NeMo Parakeet v2/v3 36 1.0 57 320
NeMo Canary v2 8 N/A 21 36
GigaAM v2/v3/v4 CTC 55 1.6 84 1370
GigaAM v2/v3/v4 RNN-T 38 1.5 40 122/166(v4)

See the Benchmarks page for detailed performance benchmarks.

Troubleshooting and FAQ

See the Troubleshooting Guide for common issues and solutions.

For more help, check the GitHub Issues or open a new one.

License

MIT License

Model weights are subject to their respective licenses.

Explorer des projets similaires

Chargement…