Downloads · 30 days
31
2% of all-time downloads
ayoubkirouane/moondream2-image-captcha
moondream2-image-captcha is a image-text-to-text model from ayoubkirouane. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
31
2% of all-time downloads
All-time downloads
1.9K
Public
Parameters
1.9B
3.7 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors3.7 GB · 100%
From the Hugging Face model README
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image
model_id = "ayoubkirouane/moondream2-image-captcha"
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id , trust_remote_code=True)
image = Image.open('/content/test.png')
enc_image = model.encode_image(image)
print(model.answer_question(enc_image, "What does the text say?", tokenizer))