advnt-screen-parser / README.md
arthuryeti's picture
Release v4: 99-class portrait 800x416 YOLOv11s ONNX (89.9% mAP@50, 74.5% mAP@50-95, 23.9ms CPU)
40ac86f verified
|
Raw History Blame Contribute Delete
7.3 kB
---
license: agpl-3.0
language:
- en
library_name: onnx
pipeline_tag: object-detection
base_model:
- Ultralytics/YOLO11
tags:
- yolo
- yolov11
- onnx
- onnxruntime
- ios
- ui-detection
- icon-detection
- mobile-agent
- screen-parsing
- ocr
- computer-vision
model-index:
- name: advnt-screen-parser-v4
results:
- task:
type: object-detection
name: iOS UI Icon Detection (99 classes)
dataset:
name: Advnt iOS Social UI Held-Out Val Set (596 frames, 4,700 boxes)
type: custom
metrics:
- name: mAP@50 (ONNX 800x416)
type: map_50
value: 0.8993
- name: mAP@50-95 (ONNX 800x416)
type: map_50_95
value: 0.7454
- name: mAP@50 (PyTorch 800)
type: map_50
value: 0.9033
- name: Precision (ONNX)
type: precision
value: 0.8526
- name: Recall (ONNX)
type: recall
value: 0.8968
---
# Advnt Screen Parser v4 (`icons.onnx` / `best.pt`)
A lightweight, CPU-fast **99-class portrait (`800×416`) YOLOv11s ONNX UI icon detector** trained on **5,268 teacher-relabeled real iPhone screens (40,330 tight icon boxes)** — covering complete bottom tab bars, app-specific back chevrons/arrows, top-left/top-right corner chrome, active engagement states (`*_liked` / `*_saved`), profile sub-tabs, account switchers, and iOS Home Screen app icons.
- **GitHub Repository (full parser, CLI, FastAPI server, Docker):** [github.com/arthuryeti/advnt-screen-parser](https://github.com/arthuryeti/advnt-screen-parser)
- **CPU Inference Speed:** **23.9 ms median** (`24.5 ms` p95) on Apple M4 Max CPU via ONNX Runtime (`2` threads, no GPU) — 22% faster than v3
- **Model Size:** `38.0 MB` (`icons.onnx`, opset 17, `1×3×800×416`) · `19.3 MB` (`best.pt`, PyTorch)
- **Works on:** Both clean iOS screenshots **and** photographed/camera-captured iPhone screens (glare, slight rotation, thin white chevrons over video)
![Advnt Screen Parser v4 Showcase](assets/hero_showcase.png)
---
## Model Files
| File | Size | Description |
| :--- | :---: | :--- |
| `icons.onnx` | 38.0 MB | Simplified portrait ONNX opset-17 export (`1×3×800×416`), CPU-ready |
| `best.pt` | 19.3 MB | Best Ultralytics YOLOv11s PyTorch checkpoint |
| `icons.json` | 5.2 KB | Input size (`[800, 416]`), 99 class ID → name mapping, and per-class validation metrics |
| `eval_summary.json` | 19 KB | Full per-class and per-platform ONNX AP@50, Precision@0.35, Recall@0.35, and CPU latency |
---
## Benchmarks
![Advnt v1 to v4 Benchmarks](assets/benchmark_v1_v4.png)
### Per-Platform Validation Metrics (`icons.onnx` on 596 held-out iPhone frames)
| Platform | Classes | Val Boxes | ONNX mAP@50 | Precision (@0.35) | Recall (@0.35) |
| :--- | :---: | :---: | :---: | :---: | :---: |
| **iOS Chrome & App Icons** | 6 | 187 | **99.0%** | 94.4% | 98.9% |
| **X / Twitter** | 22 | 1,205 | **91.6%** | 90.7% | 93.9% |
| **Instagram** | 25 | 1,076 | **90.6%** | 86.1% | 92.9% |
| **TikTok** | 27 | 1,657 | **90.4%** | 91.8% | 96.1% |
| **YouTube** | 19 | 575 | **83.7%** | 92.1% | 80.9% |
| **Overall** | **99** | **4,700** | **89.9%** | **90.3%** | **93.0%** |
### Model Progression (v1 → v2 → v3 → v4)
| Version | Backbone | Input | Classes | Dataset (Train / Val) | Val mAP@50 | Val mAP@50–95 | Recall |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| v1 | YOLOv11n | `640×640` | 15 | 1,651 (1,438 / 213) | 81.8% | 54.1% | 80.9% |
| v2 | YOLOv11s | `640×640` | 46 | 3,828 (3,338 / 490) | 77.0% | 52.3% | 79.3% |
| v3 | YOLOv11s | `640×640` | 47 | 4,574 (4,006 / 568) | 77.8% | 53.5% | 79.0% |
| **v4** | **YOLOv11s** | **`800×416`** | **99** | **5,268 (4,672 / 596)** | **89.9%** | **74.5%** | **89.7%** |
---
## Quick Usage
### Via `advnt-screen-parser` (Recommended)
```bash
pip install "git+https://github.com/arthuryeti/advnt-screen-parser.git"
```
```python
from advnt_screen_parser import IconDetector
detector = IconDetector() # auto-downloads icons.onnx from this repo
icons = detector.detect_file("screenshot.jpg")
print(icons)
```
For the full **RapidOCR + v4 Icon Detector + Geometric UI Tree** pipeline (~180 ms CPU):
```bash
pip install "advnt-screen-parser[all] @ git+https://github.com/arthuryeti/advnt-screen-parser.git"
```
```python
from advnt_screen_parser import ScreenParser
parser = ScreenParser()
result = parser.parse_file("screenshot.jpg")
print(result["elements"][:5])
```
### Direct Ultralytics Usage
```python
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download(repo_id="arthuryeti/advnt-screen-parser", filename="best.pt")
model = YOLO(weights)
results = model.predict("screenshot.jpg", imgsz=[800, 416], conf=0.35)
```
---
## 99 Supported Icon Classes
- **Instagram (25):** `ig_like`, `ig_liked`, `ig_comment`, `ig_repost`, `ig_share`, `ig_save`, `ig_saved`, `ig_more`, `ig_avatar`, `ig_audio`, `ig_home_tab`, `ig_reels_tab`, `ig_messages_tab`, `ig_search_tab`, `ig_profile_tab`, `ig_back`, `ig_create`, `ig_menu`, `ig_notifications`, `ig_threads`, `ig_account_switcher`, `ig_grid_tab`, `ig_reels_subtab`, `ig_tagged_tab`, `ig_send`
- **TikTok (27):** `tt_like`, `tt_liked`, `tt_comment`, `tt_save`, `tt_saved`, `tt_share`, `tt_avatar`, `tt_follow`, `tt_sound`, `tt_repost`, `tt_home_tab`, `tt_friends_tab`, `tt_create`, `tt_inbox_tab`, `tt_profile_tab`, `tt_back`, `tt_live`, `tt_search`, `tt_menu`, `tt_more`, `tt_add_friend`, `tt_account_switcher`, `tt_videos_tab`, `tt_repost_tab`, `tt_liked_tab`, `tt_send`, `tt_gallery`
- **X / Twitter (22):** `x_like`, `x_liked`, `x_comment`, `x_repost`, `x_save`, `x_saved`, `x_share`, `x_views`, `x_more`, `x_avatar`, `x_grok`, `x_home_tab`, `x_search_tab`, `x_grok_tab`, `x_notifications_tab`, `x_messages_tab`, `x_profile_tab`, `x_compose`, `x_back`, `x_account_switcher`, `x_media`, `x_send`
- **YouTube (19):** `yt_like`, `yt_liked`, `yt_dislike`, `yt_comment`, `yt_share`, `yt_save`, `yt_saved`, `yt_remix`, `yt_avatar`, `yt_sound`, `yt_home_tab`, `yt_reels_tab`, `yt_create`, `yt_subscriptions_tab`, `yt_profile_tab`, `yt_back`, `yt_search`, `yt_more`, `yt_cast`
- **iOS Chrome & App Icons (6):** `ios_close`, `ios_clear_search`, `ios_app_tiktok`, `ios_app_instagram`, `ios_app_x`, `ios_app_youtube`
---
## Training Details
- **Architecture:** Ultralytics YOLOv11s (`yolo11s.pt`)
- **Resolution:** Trained at `800×800`, exported static portrait **`800×416`** ONNX (`opset=17`, simplified)
- **Data Split:** 4,672 train / 596 val (~12% job-grouped deterministic hash split), strictly temporally held out from downstream evaluation benchmarks
- **Labeling:** Exhaustive per-app icon relabeling pass across all 5,268 frames (40,330 tight bounding boxes)
- **Augmentations:** Horizontal and vertical flips disabled (`fliplr=0.0`, `flipud=0.0`); tight hue jitter (`hsv_h=0.008`) to preserve red/yellow/blue active states (`*_liked`, `*_saved`, `tt_follow`), mild rotation (`2.5°`), scale (`0.18`), translation (`0.08`), and mosaic (`0.3`, closed last 10 epochs)
---
## License
The model weights (`icons.onnx` and `best.pt`) were fine-tuned from Ultralytics YOLOv11s and are distributed under **GNU AGPL-3.0**. The surrounding inference library and UI-tree code on [GitHub](https://github.com/arthuryeti/advnt-screen-parser) are licensed under **MIT**.