CLIP maps images and text into a shared embedding space for zero-shot label prediction and similarity scoring. Install as a PyTorch package and load pretrained checkpoints by name.
Overview
CLIP (Contrastive Language-Image Pre-Training) is a neural network trained on image–text pairs so natural language can steer which text best matches a given image without task-specific fine-tuning. The release ships as a Python package built on PyTorch and torchvision.
The public API loads named models with optional device selection, tokenizes input strings, and exposes encode_image, encode_text, and joint forward passes that return logits from cosine similarity of features. Models download automatically when requested unless a local checkpoint path is supplied.
Documentation and examples cover zero-shot classification on datasets such as CIFAR-100 and linear-probe evaluation with scikit-learn on extracted image features. Non-JIT loads are supported when jit is disabled.
The project is aimed at researchers and developers who want ready-made multimodal encoders for experimentation, benchmarking, and downstream pipelines rather than a hosted application.
Key features
- Pretrained multimodal encoders
- Image and text encoders
- Zero-shot image classification
- Automatic model download
- CPU and CUDA execution
- Tokenization helper
- Joint image-text scoring
- Linear probe workflows
Use cases
- Zero-shot image labeling
- Image-text similarity search
- Feature extraction for classifiers
- Research on vision-language models
- Prototyping multimodal applications