--- id: clip-anytorch version: "2.6.0" license: unclear license_treatment: unclear maintenance: dormant --- # clip-anytorch — # CLIP License: unclear · Maintenance: dormant · Downloads: 131.9K/mo ## What it is and what it does clip-anytorch is a PyPI package wrapping OpenAI's CLIP (Contrastive Language-Image Pre-Training) model. CLIP is a neural network trained on image-text pairs that learns a shared embedding space, allowing it to match images to natural-language descriptions without being explicitly trained on any specific classification task. The package provides methods to load a pretrained model, encode images and text into feature vectors, and compute similarity scores between them. The main use case is zero-shot image classification: given an image and a list of text labels, CLIP ranks the labels by how well they match the image without needing any labeled training data. It also enables image-text retrieval and similarity search. This fork removes the strict torch version dependency from the original repo and adds a truncate_text option for longer sequences, making it faster to install in environments like Google Colab. Use it for: - Zero-shot image classification: rank candidate labels for an image without task-specific training data. - Image-text retrieval: find images matching a natural-language query or vice versa. - Feature extraction for downstream tasks: encode images or text into fixed-size vectors for use in other models. - Content moderation or tagging: classify or describe image content using natural-language prompts. - Cross-modal search: build search systems that match images to text descriptions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Loads and runs OpenAI's CLIP model to encode images and text into a shared feature space, enabling zero-shot image classification and image-text matching without task-specific training. Yes, if you need zero-shot image classification or image-text matching and can accept dormant maintenance. The package is functional, has low install friction, and no known vulnerabilities. However, verify the unclear license before commercial use, and be aware that the last release was 2024-01-13—expect no active bug fixes or feature updates. ## Install pip install clip-anytorch uv add clip-anytorch poetry add clip-anytorch ## Installing clip-anytorch Before you install: Low install friction with a pure-Python wheel. Maintenance is dormant—last release was 2024-01-13 and last commit 2024-07-08—but the package remains functional. It relaxes the strict torch version constraint of the original repo, making it easier to install on modern environments. License in practice: License treatment is unclear; no SPDX identifier or raw license text is available in the metadata. Verify the actual license before using in a commercial or restricted context. Quickstart: pip install clip-anytorch import torch import clip device = "cuda" if torch.cuda.is_available() else "cpu" model, preprocess = clip.load("ViT-B/32", device=device, jit=False) text = clip.tokenize(["a dog", "a cat"]).to(device) with torch.no_grad(): text_features = model.encode_text(text) Requires torch and torchvision installed; if using torch versions other than 1.7.1, must pass jit=False to clip.load() to avoid JIT compilation errors. Verify before relying: - Whether the unclear license permits commercial or proprietary use without restriction. - Current compatibility with recent PyTorch and torchvision versions beyond what the description explicitly covers. - Whether PIL or other image-loading libraries are required as implicit dependencies for typical usage. ## Package facts - License: not declared (unclear) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 131.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags image text matching, zero-shot image classification, vision language model, clip model pytorch, image feature extraction, text image similarity, multimodal embedding, vision-language, zero-shot-learning, multimodal [View on SkillFed](https://skillfed.io/packages/clip-anytorch) · [View on PyPI](https://pypi.org/project/clip-anytorch/)