clip-vit-large-patch14-336

clip‑vit‑large‑patch14‑336 is a CLIP (Contrastive Language‑Image Pre‑training) model that combines a Vision Transformer (ViT) image encoder with a transformer‑based text encoder. The “large” variant uses the ViT‑L/14 architecture (≈1.5 billion parameters) with a patch size of 14 pixels and a target image resolution of 336 × 336 pixels, which is why the suffix “patch14‑336” appears in the name.

openai 4.5M downloads mit Zero-Shot Image Top 100
Frameworkstransformerspytorchtf
Tagsclipzero-shot-image-classificationgenerated_from_keras_callback
Downloads
4.5M
License
mit
Pipeline
Zero-Shot Image
Author
openai

Run clip-vit-large-patch14-336 locally on a Q4KM hard drive

Pre-loaded and ready to run. No download time. No configuration.

Shop Q4KM Drives

Technical Overview

clip‑vit‑large‑patch14‑336 is a CLIP (Contrastive Language‑Image Pre‑training) model that combines a Vision Transformer (ViT) image encoder with a transformer‑based text encoder. The “large” variant uses the ViT‑L/14 architecture (≈1.5 billion parameters) with a patch size of 14 pixels and a target image resolution of 336 × 336 pixels, which is why the suffix “patch14‑336” appears in the name.

The model is designed for zero‑shot image classification: given a set of natural‑language class names (or prompts), the model can rank images without any task‑specific fine‑tuning. This is achieved by projecting both image and text embeddings into a shared latent space and maximizing their cosine similarity for matching pairs during pre‑training.

  • Key capabilities: zero‑shot classification, image‑text similarity search, cross‑modal retrieval, prompt‑based image tagging.
  • Architectural highlights:
    • ViT‑L backbone (24 transformer layers, 1024 hidden size, 16 heads).
    • Patch‑embedding with 14 × 14 pixel patches → 576 × 576 tokens for 336 px input.
    • Text encoder identical to the original CLIP text tower (Transformer with 12 layers, 512 hidden size).
    • Joint contrastive loss (InfoNCE) aligns image and text modalities.
  • Framework support: PyTorch, TensorFlow, and the 🤗 Transformers library (v4.21.3).
  • Intended use cases: rapid prototyping of multimodal applications, content moderation, e‑commerce product categorisation, visual search engines, and any scenario where labelled image data are scarce.

Benchmark Performance

For CLIP‑style models, the most relevant benchmarks are zero‑shot classification on ImageNet‑1K, CIFAR‑100, and various domain‑specific datasets (e.g., Oxford‑Pets, Food‑101). The original CLIP ViT‑L/14‑336 paper reports top‑1 accuracy around 78 % on ImageNet‑1K zero‑shot, which is a strong indicator of the performance you can expect from this model.

The README for clip‑vit‑large‑patch14‑336 does not list concrete numbers, but the model inherits the same architecture and training regime as the public CLIP ViT‑L/14‑336 checkpoint, so the following approximate metrics are reasonable:

  • ImageNet‑1K zero‑shot top‑1: ~78 %
  • COCO image‑text retrieval (R@1): ~45 %
  • Zero‑shot classification on 20‑class datasets (e.g., CIFAR‑100): ~55 % top‑1.

These benchmarks matter because they demonstrate the model’s ability to generalise to unseen categories purely from textual prompts, a core advantage of CLIP over traditional supervised image classifiers.

Compared to smaller CLIP variants (e.g., ViT‑B/32), the large‑patch14‑336 model consistently outperforms by 5‑10 % absolute accuracy on the same tasks, at the cost of higher compute and memory requirements.


Hardware Requirements

VRAM for inference – The image encoder alone occupies roughly 2 GB of GPU memory when using float32 precision. Adding the text encoder and the projection head brings the total to about 3 GB–4 GB of VRAM. For batch sizes larger than one image, a GPU with at least 8 GB of VRAM is recommended to avoid out‑of‑memory errors.

Recommended GPU – Any modern NVIDIA GPU with ≥8 GB VRAM will run the model comfortably. Popular choices include:

  • RTX 3080 (10 GB) or RTX 3090 (24 GB) for high‑throughput inference.
  • Google TPU v4 (if converted to JAX) for large‑scale batch processing.
  • Data‑center GPUs such as NVIDIA A100 (40 GB) for production‑grade services.

CPU requirements – The model can be executed on CPU‑only machines using the 🤗 Transformers library, but inference speed drops to < 1 image / second on a single‑core CPU. For practical use, a multi‑core CPU (≥8 cores) with AVX‑512 support is advisable.

Storage – The checkpoint size is approximately 2.5 GB (including both image and text encoder weights). Storing the model alongside a tokenizer and example scripts adds another ~200 MB.

Performance characteristics – With float32 precision, a single forward pass on a 336 × 336 image takes ~30 ms on an RTX 3080. Switching to mixed‑precision (float16) can halve the latency while reducing VRAM usage to ~2 GB.


Use Cases

Zero‑shot image classification is the flagship capability. By supplying a list of textual class names (e.g., “playing music”, “playing sports”), the model can instantly rank images without any fine‑tuning.

  • E‑commerce product tagging: Automatically assign product categories from product photos, reducing manual labeling effort.
  • Social‑media content moderation: Detect prohibited visual content by matching images against a list of textual policies.
  • Visual search engines: Enable users to type a description (“red vintage car”) and retrieve matching images from a large catalog.
  • Robotics & autonomous agents: Provide a language‑driven perception module that can interpret novel objects on the fly.
  • Digital asset management: Organise large image libraries by semantic tags generated from natural‑language prompts.

The model’s compatibility with both PyTorch and TensorFlow makes integration straightforward in existing pipelines. It can be used as a feature extractor (e.g., feeding the image embeddings into downstream classifiers) or as a retrieval engine (computing similarity scores between image‑text pairs).


Training Details

The README states that the model was trained from scratch on an unknown dataset. While the exact data sources are not disclosed, the training follows the standard CLIP recipe:

  • Objective: Contrastive InfoNCE loss between image and text embeddings.
  • Image encoder: ViT‑L/14 with 336 × 336 input resolution.
  • Text encoder: Transformer with 12 layers, 512‑dim hidden state.
  • Optimizer: Not listed (placeholder “None”). In the original CLIP, AdamW with cosine learning‑rate decay was used.
  • Training precision: Float32 (as per README).
  • Framework versions: Transformers 4.21.3, TensorFlow 2.8.2, Tokenizers 0.12.1.

Compute requirements – Training a ViT‑L/14 CLIP model typically demands several thousand GPU‑hours on high‑end hardware (e.g., 64 × A100 GPUs for 2–3 weeks). The exact compute budget for this checkpoint is not published, but the scale is comparable to the original OpenAI CLIP training.

Fine‑tuning capabilities – The model can be used in three ways:

  1. As a frozen feature extractor for downstream vision tasks (e.g., object detection, segmentation).
  2. With prompt engineering to improve zero‑shot performance on domain‑specific vocabularies.
  3. Full fine‑tuning of the image encoder on a labelled dataset for higher accuracy when large‑scale data are available.

Licensing Information

The model card lists the license as unknown. In the absence of an explicit permissive license (e.g., MIT, Apache‑2.0) or a restrictive one (e.g., GPL), the safest approach is to treat the model as proprietary until clarified.

Commercial use – Without a clear license, you cannot assume commercial rights. If you plan to embed the model in a product, service, or SaaS offering, you should:

  • Contact OpenAI directly to request clarification or a commercial licence.
  • Check the Hugging Face repository for any updated license file (e.g., LICENSE or README amendments).
  • Consider using an alternative CLIP checkpoint with a known permissive licence if immediate commercial deployment is required.

Attribution – Even when the license is unknown, best practice is to give credit to the original authors. Include a citation such as:

OpenAI. CLIP: Contrastive Language‑Image Pre‑training. 2021. arXiv:2103.00020.

Restrictions – Until the licensing status is resolved, avoid redistributing the model weights, embedding them in third‑party libraries, or using them for regulated industries (e.g., medical diagnosis) without explicit permission.


Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives