Skip to main content
Back

Salesforce Drops BLIP on Hugging Face to Turn Raw Images Into Captions

Salesforce AI Research publishes a pretrained BLIP checkpoint on Hugging Face for conditional and unconditional image captioning, backed by a new pretraining recipe.

Pro

  • Salesforce released BLIP image-captioning-base on Hugging Face for conditional and unconditional captioning.
  • Uses CapFilt: a captioner generates synthetic captions and a filter removes noisy ones during pretraining.
  • Reports +2.8% CIDEr on captioning and +2.7% recall@1 on image-text retrieval versus prior baselines.
  • Ships with a ViT-base backbone, BSD-3-Clause license, and native Transformers integration.
  • Runs on CPU, GPU, or float16 GPU with a single torch_dtype change.
  • Reference training code available in the official Salesforce BLIP repo.

Salesforce AI Research has released the BLIP image-captioning-base checkpoint on Hugging Face, a pretrained vision-language model that turns raw images into natural language captions. The checkpoint pairs a ViT-base visual backbone with the BLIP framework introduced in the team's paper, and it ships ready to plug into the Transformers library for both conditional and unconditional captioning.

BLIP is the reference implementation of a pretraining recipe that targets one of the messier problems in vision-language learning: the web-scraped image and text pairs used to train these systems are noisy, mislabeled, and often only loosely related to the images they describe.

The bootstrapping trick behind the model

The core idea in the paper is what the authors call CapFilt, short for Captioning and Filtering. BLIP transfers flexibly to both understanding and generation tasks, and it exploits noisy web data by bootstrapping the captions: a captioner generates synthetic captions and a filter removes the noisy ones. In plain terms, the model rewrites its own training data. One head invents cleaner captions for web images, another head throws out the bad ones, and the model retrains on the improved set.

Most existing pretrained models excel at either understanding tasks or generation tasks, and performance improvements have largely come from scaling up datasets with noisy image-text pairs scraped from the web, a suboptimal source of supervision. BLIP breaks that trade-off with a single architecture that handles retrieval, captioning, and visual question answering.

Benchmarks: what CapFilt buys you

The paper reports gains across the standard vision-language benchmarks:

  • Image-text retrieval: +2.7% average recall@1
  • Image captioning: +2.8% CIDEr
  • VQA: +1.6% VQA score

BLIP also generalizes well when transferred zero-shot to video-language tasks. The specific checkpoint on Hugging Face is the base variant, pretrained on the COCO captions dataset with a ViT-base backbone. A larger ViT-large sibling is available if you want more accuracy at the cost of memory and latency.

Using it in a few lines

The model is wired into Hugging Face Transformers through the BlipProcessor and BlipForConditionalGeneration classes. You can prompt it with a text prefix to steer the caption or let it caption from scratch:

from transformers import BlipProcessor, BlipForConditionalGeneration
from PIL import Image
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base").to("cuda")
image = Image.open("photo.jpg").convert("RGB")
inputs = processor(image, "a photography of", return_tensors="pt").to("cuda")
print(processor.decode(model.generate(**inputs)[0], skip_special_tokens=True))

The model runs on CPU, full-precision GPU, or float16 GPU without any code changes beyond the torch_dtype flag. It's released under the BSD-3-Clause license, and the weights are free to download and self-host.

Where it fits, and where it stumbles

BLIP-base is a workhorse rather than a frontier model. It's useful when you need:

  • Bulk alt-text generation for image libraries or CMS pipelines.
  • Preprocessing captions to feed into a downstream text model or search index.
  • A lightweight captioning step inside a multimodal RAG pipeline.
  • A starting point for fine-tuning on a domain-specific dataset, since the ecosystem already includes dozens of community finetunes and adapters built on top of it.

The captions tend to be short and generic, and the model doesn't reason about scenes the way modern multimodal LLMs like Qwen-VL or Llama 3.2 Vision do. Salesforce also notes that the release is intended for research in support of an academic paper, and the weights weren't specifically designed or evaluated for every downstream purpose. If you need long, contextual descriptions or OCR-aware captions, a larger VLM will do better.

Why this checkpoint still earns its keep

Even with newer multimodal LLMs available, BLIP-base occupies a specific niche. It's small, fast, permissively licensed, and has become the default backbone for a large ecosystem of downstream tools, including image-editing pipelines, dataset labeling scripts, and search demos. The reference code ships alongside the weights, so teams that want to reproduce the CapFilt bootstrapping step on their own noisy image-text corpus have a clean starting point instead of reimplementing the training loop from scratch.