Adapting pretrained Salesforce BLIP to generate e-commerce-style product captions from images — no fine-tuning required.
- Hugging Face Transformers & Datasets
- PyTorch
- Pillow (PIL)
- Salesforce BLIP (
blip-image-captioning-base) - Hugging Face Hub (data + result export)
This project takes a pretrained BLIP captioning model and steers its output toward e-commerce product copy purely through prompt conditioning — no weight updates, no training loop. Fine-tuning a vision-language model is expensive and dataset-specific; prompt conditioning gets a usable stylistic shift for free, making it a practical first move before investing in a fine-tuning pass.
- Load a public product-image dataset from the Hugging Face Hub
- Load pretrained BLIP (
Salesforce/blip-image-captioning-base) - Run zero-shot captioning on sample product images
- Steer outputs toward e-commerce style via prompt conditioning
- Clean up raw captions in post-processing
- Visualize results against real listing titles
- Evaluate caption quality with ROUGE
- Test on outside images to confirm generalization
- Export and push results to the Hugging Face Hub
Zero-shot BLIP captions vs. real listing titles across a random sample — generated with no fine-tuning.
Test on an image outside the training distribution, confirming the pipeline generalizes.
ROUGE scores in this project are low by design, and that's expected rather than a flaw. Zero-shot BLIP captions describe what's visible in the image (color, garment type, pose), while real listing titles often include brand names and SKU details that have no visual signal to learn from. Low text overlap here reflects a ceiling inherent to this approach, not a failure of the pipeline.
- Open
BLIP_Product_Image_Captioning.ipynbin Google Colab. - Run all cells top to bottom — dependencies install automatically in the first cell.
- A GPU runtime is recommended (
Runtime > Change runtime type > GPU) for faster inference. - To test on your own images, use the upload cell in the notebook section covering outside-distribution testing.
- Fine-tune BLIP on this dataset's listing titles to close the gap between visual description and product copy
- Swap in
blip-image-captioning-largefor richer captions - Ship a live demo as a Hugging Face Space

