Instructions to use onnx-community/rfdetr_base-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use onnx-community/rfdetr_base-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('object-detection', 'onnx-community/rfdetr_base-ONNX');
| license: apache-2.0 | |
| pipeline_tag: object-detection | |
| library_name: transformers.js | |
| ## Usage (Transformers.js) | |
| If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library | |
| from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using: | |
| ```bash | |
| npm i @huggingface/transformers | |
| ``` | |
| **Example:** Perform object-detection with `onnx-community/rfdetr_base-ONNX`. | |
| ```js | |
| import { pipeline } from '@huggingface/transformers'; | |
| const detector = await pipeline('object-detection', 'onnx-community/rfdetr_base-ONNX'); | |
| const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg'; | |
| const output = await detector(img, { threshold: 0.75 }); | |
| console.log(output); | |
| ``` | |