npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mauriciobenjamin700/ort-vision-sdk-web

v0.2.1

Published

High-level TypeScript SDK for browser computer vision inference with ONNX Runtime Web.

Readme

@mauriciobenjamin700/ort-vision-sdk-web

npm GitHub License: MIT

High-level TypeScript SDK for browser computer vision inference on top of ONNX Runtime Web.

Mirrors the Python ort-vision-sdk API: task-oriented classes (Classifier, Detector) that handle image loading, preprocessing, execution-provider selection and postprocessing. Output is the same typed shape as the Python version (ClassificationResult, DetectionResult, BoundingBox).

Installation

npm install @mauriciobenjamin700/ort-vision-sdk-web onnxruntime-web

onnxruntime-web is a peer dependency — you bring your own version and ship the matching .wasm files yourself.

Quick start

Image classification

import { Classifier } from "@mauriciobenjamin700/ort-vision-sdk-web";

const clf = await Classifier.create("/models/resnet50.onnx", {
  labels: ["tench", "goldfish", /* ... 1000 ImageNet labels */],
});

const result = await clf.predict("/images/dog.jpg", { topK: 5 });

console.log(result.className, result.confidence);
console.log(result.probabilities);
// result.image is an RGBImage (HWC RGB Uint8Array) — the original input.

Object detection

import { Detector } from "@mauriciobenjamin700/ort-vision-sdk-web";

// labels defaults to "coco" (80 classes)
const det = await Detector.create("/models/yolov8n.onnx");

const detections = await det.predict("/images/street.jpg", {
  confThreshold: 0.4,
});

for (const d of detections) {
  console.log(d.className, d.confidence, d.bbox.asXyxy());
  // d.croppedImage is an RGBImage of just that bounding box region.
}

Accepted image inputs

predict(image) and loadImage(image) both accept:

  • string — a URL fetched via fetch().
  • Blob / File — for <input type="file"> uploads.
  • HTMLImageElement — an existing <img> tag.
  • HTMLCanvasElement / OffscreenCanvas — already-rendered canvas.
  • ImageBitmap — from createImageBitmap().
  • ImageData — raw pixel buffer (RGBA from canvas getImageData()).
  • RGBImage — the SDK's canonical HWC RGB Uint8Array wrapper.

Execution providers

The default provider order is ["webgpu", "wasm"] — ONNX Runtime tries WebGPU first and silently falls back to WebAssembly if WebGPU isn't available. You can override per task:

const clf = await Classifier.create(model, {
  labels,
  providers: ["wasm"], // force CPU
});

For WebGPU to actually engage you need a recent ORT-Web build, a Chromium-based browser with WebGPU enabled, and either secure context (https:// or localhost) or the right COOP/COEP headers if you also want SharedArrayBuffer-based wasm threading.

Status

This project is alpha — the public API is stable enough to build against, but minor versions may introduce breaking changes during the pre-1.0 phase. Pin the version range you build against.

License

MIT — see LICENSE.