mlfoundations/open_clip

An open source implementation of CLIP.

What it solves

OpenCLIP is an open-source implementation of OpenAI's Contrastive Language-Image Pre-training (CLIP), designed to provide a reproducible and scalable way to train and use contrastive models that connect images and text. It addresses the lack of open-source availability of the original CLIP training code and weights, allowing researchers and developers to train their own models on massive datasets like LAION or DataComp.

How it works

The project provides a framework for contrastive learning where an image tower (vision transformer or ConvNext) and a text tower (transformer) are trained together to maximize the similarity between a correctly paired image and its caption. It supports a wide variety of model architectures, including ViT, ConvNext, and newer experimental families like NaFlex (for variable-resolution images and audio), CoCa, and MaMMUT.

Who it’s for

It is intended for researchers and developers working on multimodal AI, specifically those needing pretrained weights for zero-shot image classification, image-text retrieval, or those wanting to build and train their own large-scale contrastive models.

Highlights

  • Extensive Pretrained Models: Provides access to a large collection of models trained on diverse datasets (LAION, DataComp, WebLI) with high zero-shot accuracy on ImageNet.
  • Multimodal Support: Beyond image-text, it includes support for audio-text contrastive training (CLAP) and generative captioning (CoCa/MaMMUT).
  • Advanced Training Stack: Includes support for FSDP2, torch.compile strategies, and variable-resolution/aspect image pipelines (NaFlex).
  • Longevous Compatibility: Maintains compatibility with original OpenAI weights and integrates with the Hugging Face Hub for easy model loading.

Related

  • Dispatch
  • Project
  • Project
  • Dispatch
  • Project