CLIP Benchmark

1.6.2 · active · verified Thu Apr 16

CLIP-benchmark is a Python library designed to evaluate CLIP-like models on a standard set of datasets for various tasks, including zero-shot classification, zero-shot retrieval, linear probing, and captioning. It supports models like OpenCLIP, Japanese CLIP, and NLLB CLIP, and integrates with datasets from torchvision, TensorFlow datasets, and VTAB. The library is currently active, with version 1.6.2, and focuses on reproducible evaluation results.

Common errors

Warnings

Install

Imports

Quickstart

This command runs a zero-shot classification benchmark on the CIFAR-10 dataset using an OpenCLIP pre-trained model (ViT-B-32-quickgelu trained on LAION-400m) and saves the results to `result.json`.

clip_benchmark eval --dataset=cifar10 --task=zeroshot_classification --pretrained=laion400m_e32 --model=ViT-B-32-quickgelu --output=result.json --batch_size=64

view raw JSON →