| --- |
| license: mit |
| tags: |
| - object-detection |
| - rf-detr |
| - coreml |
| - macos |
| - gui-agents |
| library_name: coreml |
| pipeline_tag: object-detection |
| --- |
| |
| # focused-window-detector (RF-DETR nano, CoreML) |
|
|
| Single-pass RF-DETR (nano) that detects macOS windows and the cursor from a |
| live screen capture. Exported to CoreML for on-device inference on Apple |
| Silicon. |
|
|
| **Classes:** `focused_window`, `unfocused_window`, `cursor`. |
|
|
| Strong at separating focused vs unfocused windows in real time. |
|
|
| ## Files |
|
|
| ``` |
| rf-detr-nano-checkpoint_best_total-2-fp32.mlpackage/ # CoreML model |
| ``` |
|
|
| ## Input / output |
|
|
| - **Input:** image `384 x 384` (RGB, scale 1/255). |
| - **Outputs:** `var_2267` = boxes `[1, 300, 4]` (cxcywh, normalised), |
| `var_2270` = logits `[1, 300, 4]`. |
|
|
| ## Usage |
|
|
| Runner (Swift + ScreenCaptureKit live overlay): |
| https://github.com/cianmcnally/focused_window_detector |
|
|
| ```bash |
| hf download Cianmcnally/focused-window-detector --local-dir ./model |
| ``` |
|
|
| ## Known limitations |
|
|
| - Cursor recognition covers only a narrow range of cursor shapes/sizes. |
| - Cursor bounding boxes are loose (not pixel-tight). |
| - The Dock is sometimes misdetected as `unfocused_window` on hover. |
|
|
| These are training-data gaps; see the runner repo for the improvement plan. |
|
|