Edit model card

https://huggingface.co/facebook/detr-resnet-50 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 @xenova/transformers

Example: Perform object-detection with Xenova/detr-resnet-50.

import { pipeline } from '@xenova/transformers';

const detector = await pipeline('object-detection', 'Xenova/detr-resnet-50');

const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
const output = await detector(img, { threshold: 0.9 });
// [{
//   "score": 0.9976370930671692,
//   "label": "remote",
//   "box": { "xmin": 31, "ymin": 68, "xmax": 190, "ymax": 118 }
// },
// ...
// {
//   "score": 0.9984092116355896,
//   "label": "cat",
//   "box": { "xmin": 331, "ymin": 19, "xmax": 649, "ymax": 371 }
// }]

Demo

Test it out here, or create your own object-detection demo with 1 click!

image/png


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).

Downloads last month
3,581
Inference Examples
Inference API (serverless) does not yet support transformers.js models for this pipeline type.

Model tree for Xenova/detr-resnet-50

Quantized
(1)
this model

Spaces using Xenova/detr-resnet-50 100