with ONNX weights to be compatible with Transformers.js.
Fonte do modelo
Descrição da fonte
https://huggingface.co/facebook/dino-vits16 with ONNX weights to be compatible with Transformers.js.
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
Fontes
1 fonteVerificado 9 de set.
Artefatos de modelo
7 artefatosTrechos de fonte
2 trechosnpm i @huggingface/transformers
Example: Perform image feature extraction.
import { pipeline } from '@huggingface/transformers';
const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/dino-vits16');
const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';
const features = await image_feature_extractor(url);
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).
onnx/model_q4.onnx
onnx · 14,5 MB · SHA-256 9845fca37b28…19e3 · Hugging Face
--- base_model: facebook/dino-vits16 library_name: transformers.js --- https://huggingface.co/facebook/dino-vits16 with ONNX weights to be compatible with 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 image feature extraction. ```js import { pipeline } from '@huggingface/transformers'; const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/dino-vits16'); const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png'; const features = await image_feature_extractor(url); ``` 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`).
Source context: 8595 downloads · 0 likes · Pipeline image-feature-extraction · Library transformers.js · Repo Xenova/dino-vits16