Downloads · 30 days
7
1% of all-time downloads
vkao8264/blip-yoda-captioning
blip-yoda-captioning is a image-to-text model from vkao8264. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as bsd-3-clause.
Image captioning model finetuned on BLIP-base, responds like how Yoda speaks,
Downloads · 30 days
7
1% of all-time downloads
All-time downloads
810
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
Image captioning model finetuned on BLIP-base, responds like how Yoda speaks,
"Sitting in a car, a man is"
Try web app here: https://yodacaptioner.up.railway.app/
An image-to-text model finetuned on BLIP-base with the transformers package
from PIL import Image
from transformers import AutoProcessor, BlipForConditionalGeneration
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
model = BlipForConditionalGeneration.from_pretrained("vkao8264/blip-yoda-captioning")
filepath = "path-to-your-image"
raw_image = Image.open(filepath).convert('RGB')
inputs = processor(raw_image, return_tensors="pt").to("cuda")
output_tokens = model.generate(**inputs)
caption = processor.decode(output_tokens[0], skip_special_tokens=True)
print(caption)
The model was fine-tuned on 30000 image-caption pairs from the COCO captions dataset. Specifically, captions_train2014.
Before training, captions were changed to yoda-style captions using phi3 with few-shot learning
Scripts can be found on https://github.com/vincent8264/yoda_captioning