Add/update the quantized ONNX model files and README.md for Transformers.js v3 (#1)
Browse files- Add/update the quantized ONNX model files and README.md for Transformers.js v3 (6eee87fd268b35dfcab0059b467e5ece3f73d708)
Co-authored-by: Yuichiro Tachibana <[email protected]>
README.md
CHANGED
|
@@ -6,22 +6,21 @@ pipeline_tag: object-detection
|
|
| 6 |
|
| 7 |
https://github.com/WongKinYiu/yolov9 with ONNX weights to be compatible with Transformers.js.
|
| 8 |
|
| 9 |
-
|
| 10 |
## Usage (Transformers.js)
|
| 11 |
|
| 12 |
-
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/@
|
| 13 |
```bash
|
| 14 |
-
npm i @
|
| 15 |
```
|
| 16 |
|
| 17 |
**Example:** Perform object-detection with `Xenova/yolov9-c_all`.
|
| 18 |
|
| 19 |
```js
|
| 20 |
-
import { AutoModel, AutoProcessor, RawImage } from '@
|
| 21 |
|
| 22 |
// Load model
|
| 23 |
const model = await AutoModel.from_pretrained('Xenova/yolov9-c_all', {
|
| 24 |
-
|
| 25 |
})
|
| 26 |
|
| 27 |
// Load processor
|
|
@@ -62,5 +61,4 @@ Test it out [here](https://huggingface.co/spaces/Xenova/video-object-detection)!
|
|
| 62 |
|
| 63 |
---
|
| 64 |
|
| 65 |
-
|
| 66 |
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](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).
|
|
|
|
| 6 |
|
| 7 |
https://github.com/WongKinYiu/yolov9 with ONNX weights to be compatible with Transformers.js.
|
| 8 |
|
|
|
|
| 9 |
## Usage (Transformers.js)
|
| 10 |
|
| 11 |
+
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:
|
| 12 |
```bash
|
| 13 |
+
npm i @huggingface/transformers
|
| 14 |
```
|
| 15 |
|
| 16 |
**Example:** Perform object-detection with `Xenova/yolov9-c_all`.
|
| 17 |
|
| 18 |
```js
|
| 19 |
+
import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';
|
| 20 |
|
| 21 |
// Load model
|
| 22 |
const model = await AutoModel.from_pretrained('Xenova/yolov9-c_all', {
|
| 23 |
+
dtype: "fp32", // (Optional) Use unquantized version.
|
| 24 |
})
|
| 25 |
|
| 26 |
// Load processor
|
|
|
|
| 61 |
|
| 62 |
---
|
| 63 |
|
|
|
|
| 64 |
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](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).
|