Instructions to use lumimate/PhoneUIAnchor-829M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lumimate/PhoneUIAnchor-829M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lumimate/PhoneUIAnchor-829M", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("lumimate/PhoneUIAnchor-829M", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("lumimate/PhoneUIAnchor-829M", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lumimate/PhoneUIAnchor-829M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lumimate/PhoneUIAnchor-829M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lumimate/PhoneUIAnchor-829M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lumimate/PhoneUIAnchor-829M
- SGLang
How to use lumimate/PhoneUIAnchor-829M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lumimate/PhoneUIAnchor-829M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lumimate/PhoneUIAnchor-829M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lumimate/PhoneUIAnchor-829M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lumimate/PhoneUIAnchor-829M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lumimate/PhoneUIAnchor-829M with Docker Model Runner:
docker model run hf.co/lumimate/PhoneUIAnchor-829M
PhoneUIAnchor-829M
PhoneUIAnchor-829M is a vision-language model for locating elements in mobile and web interfaces. Given a screenshot and a natural-language description, it returns the normalized center point of the target element. It can be used with GUI agents, test automation, accessibility tools, and similar visual workflows.
This repository contains a complete, standalone checkpoint that can be loaded directly with Transformers without additional model files.
Capabilities
- Intent grounding: locate the control required to complete an action.
- Description grounding: locate an element from visible or semantic traits.
- Function grounding: locate a control from a detailed functionality description.
- Cross-resolution output: return normalized 0-999 coordinates that can be mapped to any screenshot size.
- Local deployment: run from a single 829M-parameter model without an external inference API.
Technical Profile
| Property | Value |
|---|---|
| Architecture | Florence-2-large |
| Task | GUI element grounding |
| Parameters | 829M |
| Output contract | <loc_x>,<loc_y> |
| Weight format | Safetensors |
| Recommended precision | BF16 |
| Tested stack | Python 3.10, PyTorch 2.4.1, CUDA 12.1 |
Installation
pip install -r requirements.txt
Usage
The packaged Florence-2 implementation uses custom model code. Review the
included Python files and load with trust_remote_code=True.
import re
import torch
from PIL import Image
from transformers import AutoModelForCausalLM, AutoProcessor
model_id = "lumimate/PhoneUIAnchor-829M"
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
attn_implementation="sdpa",
).cuda().eval()
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
image = Image.open("ui_screenshot.png").convert("RGB")
prompt = (
'Where is the "Settings" element? '
'(Output the center coordinates of the target)'
)
inputs = processor(images=image, text=prompt, return_tensors="pt").to(
"cuda", dtype=torch.bfloat16
)
with torch.inference_mode():
output_ids = model.generate(
**inputs,
do_sample=False,
max_new_tokens=16,
)
text = processor.tokenizer.batch_decode(
output_ids, skip_special_tokens=False
)[0]
match = re.search(r"<loc_(\d+)>,<loc_(\d+)>", text)
point = tuple(map(int, match.groups())) if match else None
x_px = point[0] / 999 * image.width
y_px = point[1] / 999 * image.height
print({"normalized": point, "pixels": (x_px, y_px)})
A command-line implementation is included in inference_example.py.
Intended Use
PhoneUIAnchor-829M is intended for research and product prototyping in GUI perception, agentic interaction, automated testing, and assistive interfaces. Predictions should be validated before high-impact or irreversible automation.
Limitations
- Development data emphasizes mobile user interfaces and may not cover every desktop, game, embedded, or highly customized UI style.
- Coordinate quality can degrade on very small, occluded, or visually ambiguous controls.
Architecture and Licensing
PhoneUIAnchor-829M uses the Florence-2 architecture and is distributed under the
terms provided in LICENSE.
- Downloads last month
- 16