Add/update the quantized ONNX model files and README.md for Transformers.js v3
Browse files## Applied Quantizations
### ❌ Based on `model.onnx` *with* slimming
```
None
```
↳ ❌ `q4f16`: `model_q4f16.onnx` (added but JS-based E2E test failed)
```
file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:30853
throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${localPath}".`);
^
Error: `local_files_only=true` or `env.allowRemoteModels=false` and file was not found locally at "/tmp/tmp6lysj965/7384b309cd7f45cf8ad176a597cc5effe4e14c76/tokenizer.json".
at getModelFile (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:30853:27)
at async getModelJSON (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:30997:20)
at async Promise.all (index 0)
at async loadTokenizer (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:24010:18)
at async AutoTokenizer.from_pretrained (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:28351:50)
at async Promise.all (index 0)
at async loadItems (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:23881:5)
at async pipeline (file:///home/ubuntu/src/tjsmigration/node_modules/.pnpm/@[email protected]/node_modules/@huggingface/transformers/dist/transformers.node.mjs:23811:21)
at async file:///home/ubuntu/src/tjsmigration/src/[eval1]:8:15
Node.js v22.16.0
```
|
@@ -10,15 +10,15 @@ https://github.com/open-mmlab/mmpose/tree/main/projects/rtmo with ONNX weights t
|
|
| 10 |
|
| 11 |
## Usage (Transformers.js)
|
| 12 |
|
| 13 |
-
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/@
|
| 14 |
```bash
|
| 15 |
-
npm i @
|
| 16 |
```
|
| 17 |
|
| 18 |
**Example:** Perform pose-estimation w/ `Xenova/RTMO-s`.
|
| 19 |
|
| 20 |
```js
|
| 21 |
-
import { AutoModel, AutoProcessor, RawImage } from '@
|
| 22 |
|
| 23 |
// Load model and processor
|
| 24 |
const model_id = 'Xenova/RTMO-s';
|
|
@@ -57,7 +57,7 @@ for (let i = 0; i < predicted_boxes.length; ++i) {
|
|
| 57 |
const x2 = (xmax * xScale).toFixed(2);
|
| 58 |
const y2 = (ymax * yScale).toFixed(2);
|
| 59 |
|
| 60 |
-
console.log(`Found person at [${x1}, ${y1}, ${x2}, ${y2}] with score ${box_score.toFixed(3)}`)
|
| 61 |
const points = predicted_points[i]; // of shape [17, 3]
|
| 62 |
for (let id = 0; id < points.length; ++id) {
|
| 63 |
const label = model.config.id2label[id];
|
|
|
|
| 10 |
|
| 11 |
## Usage (Transformers.js)
|
| 12 |
|
| 13 |
+
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:
|
| 14 |
```bash
|
| 15 |
+
npm i @huggingface/transformers
|
| 16 |
```
|
| 17 |
|
| 18 |
**Example:** Perform pose-estimation w/ `Xenova/RTMO-s`.
|
| 19 |
|
| 20 |
```js
|
| 21 |
+
import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';
|
| 22 |
|
| 23 |
// Load model and processor
|
| 24 |
const model_id = 'Xenova/RTMO-s';
|
|
|
|
| 57 |
const x2 = (xmax * xScale).toFixed(2);
|
| 58 |
const y2 = (ymax * yScale).toFixed(2);
|
| 59 |
|
| 60 |
+
console.log(`Found person at [${x1}, ${y1}, ${x2}, ${y2}] with score ${box_score.toFixed(3)}`);
|
| 61 |
const points = predicted_points[i]; // of shape [17, 3]
|
| 62 |
for (let id = 0; id < points.length; ++id) {
|
| 63 |
const label = model.config.id2label[id];
|