A full-precision (bfloat16) adaptation of
google/paligemma-3b-mix-224
for accessibility vision-language tasks, trained with LoRA on the VizWiz
datasets and merged into a standalone checkpoint. It performs visual question
answering and scene captioning for blind and low-vision users, and represents
the quality ceiling of our adaptation: the
4-bit QLoRA variant
matches it to within a fraction of a point at 40% of the memory footprint, and
is the variant intended for on-device deployment.
Adaptation improves the target task substantially while leaving general-domain
performance largely intact. On VizWiz captioning, CIDEr-D rises from 55.31 to
98.08 and mean caption length from 5.03 to 10.30 words, matching the dataset's
more descriptive reference style; VizWiz-VQA accuracy rises from 73.95 to 75.80.
General-domain performance declines only modestly, by 0.50 points on VQAv2 and
5% relative on COCO-Caps.
1from transformers import PaliGemmaForConditionalGeneration, PaliGemmaProcessor
2from PIL import Image
3import torch
4
5repo = "lamao-ab/paligemma-blind-assist-lora-merged-v1"
6model = PaliGemmaForConditionalGeneration.from_pretrained(
7 repo, torch_dtype=torch.bfloat16, device_map="auto"
8)
9processor = PaliGemmaProcessor.from_pretrained(repo)
10
11image = Image.open("example.jpg").convert("RGB")
12prompt = "describe the scene for a blind person"
13inputs = processor(text=prompt, images=image, return_tensors="pt").to(model.device)
14out = model.generate(**inputs, max_new_tokens=128)
15print(processor.decode(out[0], skip_special_tokens=True))