LAION-AI/CLIP_benchmark

CLIP-like model evaluation

What it solves

CLIP Benchmark solves the problem of comparing different CLIP-like vision-language models fairly and consistently. Researchers and developers often need to know how well a model performs on standard tasks like classifying images without training, retrieving images from text, or generating captions. Without a common tool, each model is tested differently, making results hard to compare. This project provides a single command-line tool that runs the same evaluation on many models and datasets, producing standardized metrics.

How it works

You install the package (pip install clip-benchmark) and then use the clip_benchmark command. You specify which model (e.g., an OpenCLIP model like ViT-B-32 pretrained on LAION-400m) and which dataset (e.g., CIFAR-10, ImageNet, COCO captions, or many others). The tool runs the chosen task—zero-shot classification, zero-shot retrieval, linear probing, or captioning—and writes the results (like top-1 accuracy or mean average precision) into a JSON file. You can also evaluate multiple models and datasets in one run by providing lists or files, and even use template placeholders for output names. It supports many dataset sources (torchvision, TensorFlow Datasets, VTAB, webdatasets) and multilingual datasets, plus special tasks like compositionality (e.g., Sugar Crepe, Winoground).

Who it’s for

This is for machine learning researchers, engineers, and hobbyists who work with vision-language models and need to benchmark them. It’s especially useful for comparing pretrained models from different sources (OpenCLIP, Japanese CLIP, NLLB CLIP) or for checking how a model performs across many datasets and languages. The tool is designed to be easy to use from the command line, so you don’t need to write custom evaluation code.

Highlights

  • Supports multiple evaluation tasks: zero-shot classification, zero-shot retrieval, linear probing, and captioning.
  • Works with many model types: OpenCLIP, Japanese CLIP, NLLB CLIP, and you can add your own.
  • Covers a wide range of datasets: torchvision, TensorFlow Datasets, VTAB, webdatasets, and multilingual sets.
  • Includes multilingual evaluation with many languages (e.g., Chinese, Japanese, Arabic) and datasets like Babel ImageNet and Crossmodal-3600.
  • Handles compositionality tasks (Sugar Crepe, Winoground) and audio-text models (CLAP) on specific benchmarks.
  • Can evaluate multiple models and datasets in one run, with resume support (--skip_existing).
  • Provides a way to convert datasets to webdataset format and evaluate on remote Hugging Face datasets.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project