ONNX Model Zoo

Xenova/yolov9-e

By Xenova · ↓ 5 · ♥ 0 · Updated 2025-06-30

What's in this repo

This page lists the files in Xenova/yolov9-e, including model.onnx, model_fp16.onnx, model_quantized.onnx.

  • 3 ONNX models (.onnx files)
  • 8 files, including 3 .json, 3 .onnx, 1 .md
  • Last updated 2025-06-30

ONNX files

File Size Download
onnx/model.onnx — Download
onnx/model_fp16.onnx — Download
onnx/model_quantized.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

https://github.com/WongKinYiu/yolov9 with ONNX weights to be compatible with Transformers.js.

Usage (Transformers.js)

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Example: Perform object-detection with Xenova/yolov9-e.

import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';

// Load model
const model = await AutoModel.from_pretrained('Xenova/yolov9-e', {
    dtype: 'fp32',    // (Optional) Use unquantized version.
});

// Load processor
const processor = await AutoProcessor.from_pretrained('Xenova/yolov9-e');
// processor.feature_extractor.do_resize = false;                   // (Optional) Disable resizing
// processor.feature_extractor.size = { width: 128, height: 128 }   // (Optional) Update resize value

// Read image and run processor
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg';
const image = await RawImage.read(url);
const { pixel_values } = await processor(image);

// Run object detection
const { outputs } = await model({ images: pixel_values });
const predictions = outputs.tolist();

for (const [xmin, ymin, xmax, ymax, score, id] of predictions) {
    const bbox = [xmin, ymin, xmax, ymax].map(x => x.toFixed(2)).join(', ');
    console.log(`Found "${model.config.id2label[id]}" at [${bbox}] with score ${score.toFixed(2)}.`);
}
// Found "car" at [179.43, 337.57, 399.15, 418.16] with score 0.94.
// Found "car" at [447.38, 378.70, 640.22, 477.43] with score 0.93.
// Found "bicycle" at [352.49, 528.11, 463.47, 588.33] with score 0.90.
// Found "bicycle" at [0.82, 519.37, 110.09, 584.06] with score 0.89.
// Found "bicycle" at [448.96, 476.38, 556.01, 538.31] with score 0.89.
// Found "person" at [550.09, 261.24, 592.19, 331.37] with score 0.88.
// Found "person" at [472.53, 430.68, 534.50, 532.82] with score 0.87.
// Found "person" at [393.59, 481.02, 442.97, 587.68] with score 0.85.
// ...

Demo

Test it out here!


Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using 🤗 Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Model info

object-detection transformers.js
transformers.js onnx yolov9 object-detection license:gpl-3.0 region:us
↓ 5 ♥ 0

Created: 2024-02-23

Updated: 2025-06-30

View on Hugging Face

Files (8)

.gitattributes
README.md
config.json
onnx/model.onnx ONNX
onnx/model_fp16.onnx ONNX
onnx/model_quantized.onnx ONNX
preprocessor_config.json
quantize_config.json

Related models