Downloads · 30 days
6
14% of all-time downloads
kxm1k4m1/icu-mama-cooking
icu-mama-cooking is a image-to-text model from kxm1k4m1. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as mit.
fine-tuned for image captioning task from blip2-opt-2.7b-coco with MSCOCO2017 thai caption.
Downloads · 30 days
6
14% of all-time downloads
All-time downloads
42
Public
Parameters
9.6B
40.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors38.5 GB · 94%
From the Hugging Face model README
fine-tuned for image captioning task from blip2-opt-2.7b-coco with MSCOCO2017 thai caption.
from transformers import Blip2ForConditionalGeneration, Blip2Processor
from PIL import Image
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = Blip2Processor.from_pretrained("kxm1k4m1/icu-mama-cooking")
model = Blip2ForConditionalGeneration.from_pretrained("kxm1k4m1/icu-mama-cooking", device_map=device, torch_dtype=torch.bfloat16)
img = Image.open("Your image...")
inputs = processor(images=img, return_tensors="pt").to(device, torch.bfloat16)
# Adjust your `max_length`
generated_ids = model.generate(**inputs, max_length=20)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)
print(generated_text)