Downloads · 30 days
17
21% of all-time downloads
miketes/wave-ui-7b
wave-ui-7b is a machine learning model from miketes. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Fine-tuned Qwen/Qwen2.5-VL-7B-Instruct on agentsea/wave-ui-25k for UI element grounding — given a screenshot and a button name, returns the bounding box coordinates.
Downloads · 30 days
17
21% of all-time downloads
All-time downloads
81
Public
Parameters
8.3B
16.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.6 GB · 100%
From the Hugging Face model README
Fine-tuned Qwen/Qwen2.5-VL-7B-Instruct on agentsea/wave-ui-25k for UI element grounding — given a screenshot and a button name, returns the bounding box coordinates.
from transformers import Qwen2_5_VLForConditionalGeneration, Qwen2_5_VLProcessor
from qwen_vl_utils import process_vision_info
from PIL import Image
import torch, re
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"miketes/wave-ui-7b", torch_dtype=torch.bfloat16, device_map="auto"
)
processor = Qwen2_5_VLProcessor.from_pretrained("miketes/wave-ui-7b")
image = Image.open("screenshot.png").convert("RGB")
messages = [{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": 'Where is the "login button"? Return the bounding box.'},
],
}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, _ = process_vision_info(messages)
inputs = processor(text=[text], images=image_inputs, return_tensors="pt").to(model.device)
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
result = processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
coords = re.findall(r'\d+', result)
bbox = [int(x) for x in coords[:4]] if len(coords) >= 4 else None
print(bbox) # [678, 99, 772, 138]