mlfoundations/open_clip

An open source implementation of CLIP.

What it solves

OpenCLIP is an open-source implementation of OpenAI's CLIP (Contrastive Language-Image Pre-training), providing a framework to train and use large-scale models that can understand the relationship between images and text. It allows researchers and developers to access a wide variety of pretrained models trained on massive datasets like LAION and DataComp, removing the need to to train these resource-intensive models from scratch.

How it works

The project implements a contrastive learning approach where an image encoder and a text encoder are trained to map images and their corresponding captions into a shared embedding space. This allows the system to determine how well a specific image matches a specific piece of text. The library supports various architectures, including Vision Transformers (ViT) and ConvNext, and integrates with tools like timm for image encoders and Hugging Face for tokenizers.

Who it’s for

It is designed for AI researchers, machine learning engineers, and developers building applications that require zero-shot image classification, image-text retrieval, or multimodal understanding.

Highlights

  • Extensive Pretrained Library: Access to numerous models trained on datasets like LAION-2B and DataComp-1B with high zero-shot ImageNet accuracy.
  • Diverse Model Families: Support for CLIP, SigLIP, CoCa, MaMMUT, and newer experimental architectures like NaFlex (variable-resolution images and audio).
  • Advanced Training Stack: Includes support for FSDP2, torch.compile strategies, and length bucketing to optimize training efficiency.
  • Multimodal Expansion: Beyond images, it supports audio-text contrastive training (CLAP) and generative captioning (GenLIP/GenLAP).

Related

  • Dispatch
  • Project
  • Project
  • Dispatch
  • Dispatch