Views
No views yet
1import torch, PIL.Image as Image
2from transformers import AutoModelForCausalLM, AutoProcessor
3
4# --- load pipeline -----------------------------------------------------------
5device = "cuda" if torch.cuda.is_available() else "cpu"
6model_name = "macpaw-research/GUIrilla-See-0.7B" # 0.7 B weights
7dtype = torch.bfloat16 if device == "cuda" else torch.float32
8
9model = AutoModelForCausalLM.from_pretrained(
10 model_name, torch_dtype=dtype, trust_remote_code=True
11).to(device)
12
13processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
14
15# --- inference ---------------------------------------------------------------
16image = Image.open("screenshot.png").convert("RGB")
17task_prompt = "<OPEN_VOCABULARY_DETECTION>"
18text_query = "button with the label “Submit”"
19
20prompt = task_prompt + text_query
21inputs = processor(text=prompt, images=[image], return_tensors="pt").to(device, dtype)
22
23with torch.no_grad():
24 ids = model.generate(
25 input_ids = inputs["input_ids"],
26 pixel_values= inputs["pixel_values"],
27 max_new_tokens = 1024,
28 num_beams = 3,
29 do_sample = False,
30 early_stopping = False,
31 )
32
33decoded = processor.batch_decode(ids, skip_special_tokens=False)[0]
34result = processor.post_process_generation(
35 decoded, task=task_prompt, image_size=image.size
36)["<OPEN_VOCABULARY_DETECTION>"]
37| Split | Success Rate % |
|---|---|
| Test | 53.55 |
LICENSE).@article{garkot2025guirilla,
title={GUIrilla: A Scalable Framework for Automated Desktop UI Exploration},
author={Garkot, Sofiya and Shamrai, Maksym and Synytsia, Ivan and Hirna, Mariya},
journal={arXiv preprint arXiv:2510.16051},
year={2025},
url={https://arxiv.org/abs/2510.16051}
}