Fine-tuned Florence-2-base-ft for UI icon captioning, used as the caption model in OmniParser v2.
This model extends the original OmniParser icon captioning weights with:
| Metric | Before | After |
|---|---|---|
| Florence-2 latency | 342ms | 148ms |
| Total elements | 316 | 316 |
| Icons to Florence | 71 | 71 |
| Icon | Before | After |
|---|---|---|
| Street View pegman | "A notification or alert." | "pegman" |
| Rotation control (BL) | "Refresh or reload." | "street view rotation" |
| Rotation control (BR) | "A painting or painting tool." | "street view rotation" |
| Location marker | "Location or location marker." | "Location" |
| User profile | "a user profile or account." | "user profile" |
| Record player | "a record player." | "record player" |
| Suitcase | "a suitcase or baggage." | "suitcase" |
47 icon captions changed total. Most changes are minor wording improvements (shorter, more precise). 3 new custom icon types learned.
from transformers import AutoProcessor, AutoModelForCausalLM
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"proteus-computer-use/omniparser-finetuned",
torch_dtype=torch.float16,
trust_remote_code=True,
).to("cuda")
# Caption a 64x64 icon crop
inputs = processor(images=icon_crop, text="<CAPTION>", return_tensors="pt").to("cuda")
generated_ids = model.generate(
input_ids=inputs["input_ids"],
pixel_values=inputs["pixel_values"],
max_new_tokens=20,
num_beams=1,
)
caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
microsoft/Florence-2-base-ft