Upload folder using huggingface_hub
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879---license: apache-2.0library_name: rfdetrpipeline_tag: object-detectiontags: - object-detection - rf-detr - ui-understanding - screen-parsing - webdatasets: - docling-project/screenparse---
# ScreenParser RF-DETR Medium (UI element detector)
Detects the UI elements of a web page screenshot (buttons, links, text inputs,checkboxes, headings, images, menus, ...) with a box, a class and a confidence. Itgives no text: pair it with OCR to read the labels.
- **Model**: [RF-DETR](https://github.com/roboflow/rf-detr) Medium (34M parameters), LoRA on the DINOv2 backbone, trained at 1024 px.- **Classes**: the 53 UI classes of ScreenParse (`class_names` in the checkpoint).- **Training data**: [ScreenParse](https://huggingface.co/datasets/docling-project/screenparse) (CC-BY-4.0, Gurbuz et al., 2026): 94k screenshots × 5 epochs from the COCO weights, then 2 epochs on 47k further, unseen screenshots at a lower learning rate.
## Results
On 2,982 test screenshots of websites never seen in training:
| mAP50 | mAP50-95 | Precision | Recall | F1 ||---|---|---|---|---|| 0.265 | 0.206 | 0.30 | 0.27 | 0.26 |
Averages over all 53 classes, many of them rare. The common form and page elementsscore much higher (AP50-95): Radio button 0.78, Text input 0.70, Checkbox 0.68,Heading 0.55, Logo 0.53, Image 0.51, Text 0.42, Button 0.40.
## Use
```bashpip install rfdetr huggingface_hub```
```pythonfrom huggingface_hub import hf_hub_downloadfrom rfdetr import RFDETR
path = hf_hub_download("REPO_ID", "model.pth") # e.g. "your-name/screenparser-rfdetr-medium"model = RFDETR.from_checkpoint(path)
detections = model.predict("screenshot.png", threshold=0.3)for box, name, score in zip( detections.xyxy, detections.data["class_name"], detections.confidence): x1, y1, x2, y2 = box print(f"{name:15s} {score:.2f} center=({(x1 + x2) / 2:.0f}, {(y1 + y2) / 2:.0f})")```
- **Threshold ~0.3**: this model scores most real elements between 0.3 and 0.5; at RF-DETR's default 0.5 it shows only the most certain few.- Input: a screenshot as a file path, PIL image or RGB numpy array. Boxes come back in the screenshot's pixels (x1, y1, x2, y2).- A GPU (CUDA or Apple MPS) is used when available; a CPU works, slower.
## Limitations
- Trained on rendered web pages: native desktop or mobile apps may do worse.- Weak on rare elements (dropdowns, tables, tabs, date pickers) and on rich-text editors, which it often does not see as inputs.- Boxes and classes only, no text.
## Credits
Data: ScreenParse, A. Said Gurbuz, Sunghwan Hong, Ahmed Nassar, Marc Pollefeys, PeterStaar, *ScreenParse: Moving Beyond Sparse Grounding with Complete Screen ParsingSupervision*, ICML 2026 (arXiv:2602.14276), CC-BY-4.0. Base model: RF-DETR byRoboflow, Apache-2.0.123version https://git-lfs.github.com/spec/v1oid sha256:98afbb3afce91e3ca198a1015cedc3fb6fb3186985cd2d4d69c7a3b2731d754fsize 140876051README.mdAdded+79
model.pthAdded+3