clip

Performs zero-shot image classification and image-text matching using OpenAI's CLIP model.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Classifying images or searching image collections normally requires labeled training data and model fine-tuning. CLIP removes that requirement by matching images to natural language descriptions directly, enabling classification, search, and moderation without any training. ## Core Features & Use Cases - Zero-Shot Image Classification: Classify images into arbitrary text-defined categories without training data, using models like ViT-B/32. - Semantic Image Search: Encode images and text queries into a shared embedding space for cross-modal retrieval, integrable with vector databases like Chroma or FAISS. - Content Moderation: Score images against safety categories such as NSFW or violent content with confidence thresholds. - Use Case: Index a folder of product photos with CLIP embeddings, then retrieve the most relevant images for the query "a sunset over the ocean" ranked by cosine similarity. ## Quick Start Install CLIP with pip and ask the agent 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 compute softmax over the model's logits. Descriptive labels like "a photo of a dog" perform better than single words.

How to build semantic image search with CLIP embeddings?▼

Encode all images with model.encode_image, normalize the embeddings, then encode a text query and rank images by cosine similarity. Embeddings can be stored in vector databases like Chroma or FAISS for fast retrieval.

CLIP vs BLIP-2 vs LLaVA for vision-language tasks?▼

CLIP is best for classification, retrieval, and image-text matching. BLIP-2 produces better image captions, while LLaVA supports vision-language chat. For segmentation, use Segment Anything instead.

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

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

Does CLIP require a GPU for image encoding?▼

No, CLIP runs on CPU, but a GPU is 10-50x faster. Image encoding takes roughly 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 handles broad categories but struggles with fine-grained tasks, spatial reasoning, and counting. It produces whole-image embeddings only, with no bounding boxes, and may reflect biases from its web training data.