Downloads · 30 days
7
5% of all-time downloads
SIYAKSARES/fine-tuned-blip-for-car-brands
fine-tuned-blip-for-car-brands is a image-to-text model from SIYAKSARES. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as apache-2.0.
This repository hosts a fine-tuned BLIP image captioning model specialized for car brand identification from images via captions. The model is trained from Salesforce/blip-image-captioning-base and produces captions l…
Downloads · 30 days
7
5% of all-time downloads
All-time downloads
137
Public
Parameters
247M
990 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
This repository hosts a fine-tuned BLIP image captioning model specialized for car brand identification from images via captions. The model is trained from Salesforce/blip-image-captioning-base and produces captions like: "A photo of a car from the brand Audi." Then, a simple brand-extraction layer maps captions to the final brand prediction.
https://huggingface.co/SIYAKSARES/fine-tuned-blip-for-car-brandsSalesforce/blip-image-captioning-baseDataset: Kaggle Car Brand Classification Dataset (33 brands; class-balanced splits)
from transformers import BlipProcessor, BlipForConditionalGeneration
from PIL import Image
processor = BlipProcessor.from_pretrained("SIYAKSARES/fine-tuned-blip-for-car-brands")
model = BlipForConditionalGeneration.from_pretrained("SIYAKSARES/fine-tuned-blip-for-car-brands")
image = Image.open("your_test_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
generated_ids = model.generate(**inputs, num_beams=3, max_new_tokens=16)
caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print("Generated caption:", caption)
num_beams=1 (greedy decoding).If you use this model, please also cite the BLIP paper:
@article{blip2022,
title={BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation},
author={Li, Junnan and Li, Dongxu and Xiong, Caiming and Hoi, Steven},
journal={ICML},
year={2022}
}