Skip to main content

fonnx 1.0.0 copy "fonnx: ^1.0.0" to clipboard
fonnx: ^1.0.0 copied to clipboard

ONNX model inference for Dart and Flutter on every platform: ONNX Runtime through FFI on native, Web Workers on the web. Embeddings, Whisper, Kokoro TTS, and more.

example/example.md

fonnx examples #

The example app in this directory runs every model. These are the two basic steps.

Download a model #

The model files are on Hugging Face, not in the package. The catalog pins each file's URL, size and SHA-256, and the helper checks the file before it is used:

import 'package:fonnx/runtime_models.dart';

final model = await ensureFonnxRuntimeModel(
  'pyannote/pyannote_seg3.onnx',
  modelDirectory,
);

Spot keywords in a microphone stream #

final spotter = await KeywordSpotter.load(
  bundle: KeywordSpotterBundle.gigaSpeech3m(modelDirectory),
  keywords: const [
    KeywordPhrase('telosnex', spokenForms: ['tell us next']),
  ],
);
spotter.detections.listen((event) => print(event.phrase));
await spotter.acceptPcm16(microphoneBytes);
await spotter.close();

See the package README for embeddings, Whisper, Kokoro, FUTO Swipe and the other models.

0
likes
160
points
1.12k
downloads

Documentation

API reference

Publisher

verified publishertelosnex.com

Weekly Downloads

ONNX model inference for Dart and Flutter on every platform: ONNX Runtime through FFI on native, Web Workers on the web. Embeddings, Whisper, Kokoro TTS, and more.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

archive, args, code_assets, crypto, ffi, hooks, kiln, ml_linalg, path

More

Packages that depend on fonnx