Zum Inhalt springen
ModelAufgelistetExtern
Herunterladen

Owlvit Base Patch32

with ONNX weights to be compatible with Transformers.js.

ArtOtherBasismodellgoogle/owlvit-base-patch32VersionRevision b75f4e5BBewertung

Modellquelle

Art
Other
Dateigröße
121–584 MB
Basismodell
google/owlvit-base-patch32
Version
vRevision b75f4e5
Aktualisiert
10. Okt. 2026
Downloads
15.698
Quelle
Hugging Face

Quellenbeschreibung

https://huggingface.co/google/owlvit-base-patch32 with ONNX weights to be compatible with Transformers.js.

Usage (Transformers.js)

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Example: Zero-shot object detection w/ Xenova/owlvit-base-patch32.

import { pipeline } from '@huggingface/transformers';

const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');

const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';
const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];
const output = await detector(url, candidate_labels);
// [
//   { score: 0.24392342567443848, label: 'human face', box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 } },
//   { score: 0.15129457414150238, label: 'american flag', box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 } },
//   { score: 0.13649864494800568, label: 'helmet', box: { xmin: 277, ymin: 337, xmax: 511, ymax: 511 } },
//   { score: 0.10262022167444229, label: 'rocket', box: { xmin: 352, ymin: -1, xmax: 463, ymax: 287 } }
// ]

image/png

Example: Zero-shot object detection w/ Xenova/owlvit-base-patch32 (additional parameters).

import { pipeline } from '@huggingface/transformers';

const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');

const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/beach.png';
const candidate_labels = ['hat', 'book', 'sunglasses', 'camera'];
const output = await detector(url, candidate_labels, { top_k: 4, threshold: 0.05 });
// [
//   { score: 0.1606510728597641, label: 'sunglasses', box: { xmin: 347, ymin: 229, xmax: 429, ymax: 264 } },
//   { score: 0.08935828506946564, label: 'hat', box: { xmin: 38, ymin: 174, xmax: 258, ymax: 364 } },
//   { score: 0.08530698716640472, label: 'camera', box: { xmin: 187, ymin: 350, xmax: 260, ymax: 411 } },
//   { score: 0.08349756896495819, label: 'book', box: { xmin: 261, ymin: 280, xmax: 494, ymax: 425 } }
// ]

image/png


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).

Quellen

1 Quelle
Hugging FacePrimärVersion b75f4e52949639c3bb0b96546ea4149482f6e7ef
huggingface.co/Xenova/owlvit-base-patch32/tree/b75f4e52949639c3bb0b96546ea4149482f6e7ef

Verifiziert 10. Okt.

Modellartefakte

7 Artefakte

onnx/model_bnb4.onnx

onnx · 175 MB · SHA-256 fd2cdf5a167e…2ca2 · Hugging Face

Herunterladen

onnx/model_fp16.onnx

onnx · 293 MB · SHA-256 9b555440a1ce…cf6a · Hugging Face

Herunterladen

onnx/model_q4.onnx

onnx · 183 MB · SHA-256 d8588092fea3…73a8 · Hugging Face

Herunterladen

onnx/model_q4f16.onnx

onnx · 121 MB · SHA-256 259c628beee5…b6a0 · Hugging Face

Herunterladen

onnx/model_quantized.onnx

onnx · 148 MB · SHA-256 06af49bd5db9…4156 · Hugging Face

Herunterladen

onnx/model_uint8.onnx

onnx · 148 MB · SHA-256 b597d1fc9ebf…a598 · Hugging Face

Herunterladen

onnx/model.onnx

onnx · 584 MB · SHA-256 38d7e8b11298…6b80 · Hugging Face

Herunterladen

Quellenauszüge

3 Auszüge

--- base_model: google/owlvit-base-patch32 library_name: transformers.js pipeline_tag: zero-shot-object-detection --- https://huggingface.co/google/owlvit-base-patch32 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:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32`. ```js import { pipeline } from '@huggingface/transformers'; const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32'); const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png'; const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag']; const output = await detector(url, candidate_labels); // [ // { score: 0.24392342567443848, label: 'human face', box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 } }, // { score: 0.15129457414150238, label: 'american flag', box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 } }, // { score: 0.13649864494800568, label: 'helmet', box: { xmin: 277, ymin: 337, xmax: 511, ymax: 511 } }, // { score: 0.10262022167444229, label: 'rocket', box: { xmin: 352, ymin: -1, xmax: 463, ymax: 287 } } // ] ``` ![image/png](https://cdn-uploads.huggingface.co/production/uploads/61b253b7ac5ecaae3d1efe0c/rNLU-bl1_H0HrPgkPMhso.png) **Example:** Zero-shot object detection w/ `Xenova/owlvit-base-patch32` (additional parameters). ```js import { pipeline } from '@huggingface/transformers'; const detector = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32'); const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/beach.png'; const candidate_labels = ['hat', 'book', 'sunglasses', 'camera']; const output = await detector(url, candidate_labels, { top_k: 4, threshold: 0.05 }); // [ // { score: 0.1606510728597641, label: 'sunglasses', box: { xmin: 347, ymin: 229, xmax: 429, ymax: 264 } }, // { score: 0.08935828506946564, label: 'hat', box: { xmin: 38, ymin: 174, xmax: 258, ymax: 364 } }, // { score: 0.08530698716640472, label: 'camera', box: { xmin: 187, ymin: 350, xmax: 260, ymax: 411 } }, // { score: 0.08349756896495819, label: 'book', box: {...

Source context: 15698 downloads · 1 likes · Pipeline zero-shot-object-detection · Library transformers.js · Repo Xenova/owlvit-base-patch32

Source context: 1845 downloads · 1 likes · Pipeline zero-shot-object-detection · Library transformers.js · Repo Xenova/owlvit-base-patch32