clip

Classify images and compute image-text similarity using OpenAI's CLIP model.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill clip-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clip
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/optional-skills/mlops/clip
Command: npx skills add https://github.com/xu1713/openhorse --skill clip-xu1713

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, pillow, and includes references (resource) components.

What problem does it solve? It enables zero-shot image classification and image-text matching without training custom models, letting you search, categorize, and moderate images using natural language descriptions. ## Core Features & Use Cases - Zero-Shot Classification: Classify images into arbitrary text categories without any training data or fine-tuning. - Semantic Image Search: Index image embeddings and retrieve them with natural language queries, with integration support for vector databases like Chroma and FAISS. - Content Moderation: Detect NSFW, violent, or graphic content by scoring images against safety category descriptions. - Use Case: Build an image search engine where users type "a sunset over the ocean" and instantly retrieve the most relevant photos from a large unlabeled image collection. ## Quick Start Install the CLIP package and torch, then ask the AI to classify an image against a list of text labels using the ViT-B/32 model.

Frequently Asked Questions about clip

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I do zero-shot image classification with CLIP?

Load a model with clip.load("ViT-B/32"), preprocess the image, tokenize your text labels, then call model(image, text) to get logits. Apply softmax to get probabilities for each label without any training.

Which CLIP model should I use: RN50, ViT-B/32, or ViT-L/14?

ViT-B/32 is recommended for most cases, balancing speed and quality with 151M parameters. RN50 is fastest, while ViT-L/14 gives the best quality but is the slowest at 428M parameters.

Can CLIP be used for semantic image search?

Yes, encode images into normalized embeddings, then encode a text query and compute cosine similarity to rank images. Embeddings can be stored in vector databases like Chroma or FAISS for efficient retrieval.

Does CLIP require a GPU to run?

No, CLIP runs on CPU, but a GPU is 10-50x faster. Image encoding takes about 200ms on CPU versus 20ms on a V100 GPU, so GPU is recommended for batch processing.

What are the limitations of CLIP for image understanding?

CLIP works best for broad categories, not fine-grained tasks. It cannot produce bounding boxes, has weak spatial and counting understanding, requires descriptive text labels, and may carry biases from its web training data.