Xenova HF Staff commited on
Commit
bcb1272
·
verified ·
1 Parent(s): f8dccde

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: object-detection
4
+ library_name: transformers.js
5
+ ---
6
+
7
+ ---
8
+ license: apache-2.0
9
+ base_model:
10
+ - PekingU/rtdetr_v2_r18vd
11
+ pipeline_tag: object-detection
12
+ library_name: transformers.js
13
+ ---
14
+
15
+ ## Usage (Transformers.js)
16
+
17
+ If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library
18
+ from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
19
+ ```bash
20
+ npm i @huggingface/transformers
21
+ ```
22
+
23
+ **Example:** Perform object-detection with `onnx-community/rfdetr_base-ONNX`.
24
+
25
+ ```js
26
+ import { pipeline } from '@huggingface/transformers';
27
+
28
+ const detector = await pipeline('object-detection', 'onnx-community/rfdetr_base-ONNX');
29
+
30
+ const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
31
+ const output = await detector(img, { threshold: 0.75 });
32
+ console.log(output);
33
+ ```