Xenova / clip-vit-base-patch16

huggingface.co
Total runs: 91.7K
24-hour runs: -105
7-day runs: 430
30-day runs: -184
Model's Last Updated: October 08 2024
zero-shot-image-classification

Introduction of clip-vit-base-patch16

Model Details of clip-vit-base-patch16

https://huggingface.co/openai/clip-vit-base-patch16 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 @xenova/transformers

Example: Perform zero-shot image classification with the pipeline API.

const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch16');
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
const output = await classifier(url, ['tiger', 'horse', 'dog']);
// [
//   { score: 0.9993917942047119, label: 'tiger' },
//   { score: 0.0003519294841680676, label: 'horse' },
//   { score: 0.0002562698791734874, label: 'dog' }
// ]

Example: Perform zero-shot image classification with CLIPModel .

import { AutoTokenizer, AutoProcessor, CLIPModel, RawImage } from '@xenova/transformers';

// Load tokenizer, processor, and model
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');
const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');
const model = await CLIPModel.from_pretrained('Xenova/clip-vit-base-patch16');

// Run tokenization
const texts = ['a photo of a car', 'a photo of a football match'];
const text_inputs = tokenizer(texts, { padding: true, truncation: true });

// Read image and run processor
const image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');
const image_inputs = await processor(image);

// Run model with both text and pixel inputs
const output = await model({ ...text_inputs, ...image_inputs });
// {
//   logits_per_image: Tensor {
//     dims: [ 1, 2 ],
//     data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],
//   },
//   logits_per_text: Tensor {
//     dims: [ 2, 1 ],
//     data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],
//   },
//   text_embeds: Tensor {
//     dims: [ 2, 512 ],
//     data: Float32Array(1024) [ ... ],
//   },
//   image_embeds: Tensor {
//     dims: [ 1, 512 ],
//     data: Float32Array(512) [ ... ],
//   }
// }

Example: Compute text embeddings with CLIPTextModelWithProjection .

import { AutoTokenizer, CLIPTextModelWithProjection } from '@xenova/transformers';

// Load tokenizer and text model
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');
const text_model = await CLIPTextModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');

// Run tokenization
const texts = ['a photo of a car', 'a photo of a football match'];
const text_inputs = tokenizer(texts, { padding: true, truncation: true });

// Compute embeddings
const { text_embeds } = await text_model(text_inputs);
// Tensor {
//   dims: [ 2, 512 ],
//   type: 'float32',
//   data: Float32Array(1024) [ ... ],
//   size: 1024
// }

Example: Compute vision embeddings with CLIPVisionModelWithProjection .

import { AutoProcessor, CLIPVisionModelWithProjection, RawImage } from '@xenova/transformers';

// Load processor and vision model
const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');
const vision_model = await CLIPVisionModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');

// Read image and run processor
const image = await RawImage.read('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');
const image_inputs = await processor(image);

// Compute embeddings
const { image_embeds } = await vision_model(image_inputs);
// Tensor {
//   dims: [ 1, 512 ],
//   type: 'float32',
//   data: Float32Array(512) [ ... ],
//   size: 512
// }

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

Runs of Xenova clip-vit-base-patch16 on huggingface.co

91.7K
Total runs
-105
24-hour runs
560
3-day runs
430
7-day runs
-184
30-day runs

More Information About clip-vit-base-patch16 huggingface.co Model

clip-vit-base-patch16 huggingface.co

clip-vit-base-patch16 huggingface.co is an AI model on huggingface.co that provides clip-vit-base-patch16's model effect (), which can be used instantly with this Xenova clip-vit-base-patch16 model. huggingface.co supports a free trial of the clip-vit-base-patch16 model, and also provides paid use of the clip-vit-base-patch16. Support call clip-vit-base-patch16 model through api, including Node.js, Python, http.

clip-vit-base-patch16 huggingface.co Url

https://huggingface.co/Xenova/clip-vit-base-patch16

Xenova clip-vit-base-patch16 online free

clip-vit-base-patch16 huggingface.co is an online trial and call api platform, which integrates clip-vit-base-patch16's modeling effects, including api services, and provides a free online trial of clip-vit-base-patch16, you can try clip-vit-base-patch16 online for free by clicking the link below.

Xenova clip-vit-base-patch16 online free url in huggingface.co:

https://huggingface.co/Xenova/clip-vit-base-patch16

clip-vit-base-patch16 install

clip-vit-base-patch16 is an open source model from GitHub that offers a free installation service, and any user can find clip-vit-base-patch16 on GitHub to install. At the same time, huggingface.co provides the effect of clip-vit-base-patch16 install, users can directly use clip-vit-base-patch16 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

clip-vit-base-patch16 install url in huggingface.co:

https://huggingface.co/Xenova/clip-vit-base-patch16

Url of clip-vit-base-patch16

clip-vit-base-patch16 huggingface.co Url

Provider of clip-vit-base-patch16 huggingface.co

Xenova
ORGANIZATIONS

Other API from Xenova

huggingface.co

Total runs: 521.1K
Run Growth: -180.2K
Growth Rate: -34.58%
Updated:August 28 2025
huggingface.co

Total runs: 144.9K
Run Growth: 106.5K
Growth Rate: 73.49%
Updated:February 11 2026
huggingface.co

Total runs: 104.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 17 2025
huggingface.co

Total runs: 97.2K
Run Growth: 11.6K
Growth Rate: 11.95%
Updated:December 17 2025
huggingface.co

Total runs: 56.5K
Run Growth: 1.2K
Growth Rate: 2.19%
Updated:July 22 2025
huggingface.co

Total runs: 33.7K
Run Growth: 2.6K
Growth Rate: 7.78%
Updated:July 12 2025
huggingface.co

Total runs: 30.1K
Run Growth: 4.7K
Growth Rate: 15.68%
Updated:June 25 2025
huggingface.co

Total runs: 26.7K
Run Growth: 14.8K
Growth Rate: 55.46%
Updated:July 11 2025
huggingface.co

Total runs: 20.3K
Run Growth: 889
Growth Rate: 4.38%
Updated:June 30 2025
huggingface.co

Total runs: 12.8K
Run Growth: -22
Growth Rate: -0.17%
Updated:July 26 2025
huggingface.co

Total runs: 9.4K
Run Growth: -130
Growth Rate: -1.38%
Updated:October 27 2025
huggingface.co

Total runs: 8.9K
Run Growth: 834
Growth Rate: 9.36%
Updated:July 11 2025
huggingface.co

Total runs: 6.9K
Run Growth: -305.8K
Growth Rate: -4430.60%
Updated:August 28 2025
huggingface.co

Total runs: 6.8K
Run Growth: 949
Growth Rate: 14.65%
Updated:January 09 2026
huggingface.co

Total runs: 5.1K
Run Growth: 1.6K
Growth Rate: 32.11%
Updated:August 19 2025
huggingface.co

Total runs: 4.8K
Run Growth: -2.0K
Growth Rate: -42.68%
Updated:August 28 2025
huggingface.co

Total runs: 2.7K
Run Growth: -159
Growth Rate: -5.95%
Updated:August 19 2025
huggingface.co

Total runs: 2.6K
Run Growth: 252
Growth Rate: 9.68%
Updated:July 01 2025
huggingface.co

Total runs: 2.6K
Run Growth: -189
Growth Rate: -7.35%
Updated:June 25 2025
huggingface.co

Total runs: 2.1K
Run Growth: -143
Growth Rate: -6.49%
Updated:October 08 2024
huggingface.co

Total runs: 2.0K
Run Growth: -1.2K
Growth Rate: -60.09%
Updated:July 22 2025
huggingface.co

Total runs: 1.9K
Run Growth: 749
Growth Rate: 39.42%
Updated:July 11 2025
huggingface.co

Total runs: 1.9K
Run Growth: 459
Growth Rate: 24.29%
Updated:December 17 2025
huggingface.co

Total runs: 1.4K
Run Growth: 121
Growth Rate: 8.61%
Updated:July 11 2025