91e75e620b
CI: cua-driver distro-compat matrix / Resolve release version (push) Waiting to run
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / Distro compat summary (push) Blocked by required conditions
CI: Nix Linux Rust source / Nix / compositor build (push) Waiting to run
CI: Nix Linux Rust source / Nix / driver package (push) Waiting to run
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Waiting to run
CI: Rust Linux unit / Rust Linux unit and compile (push) Waiting to run
CI: Rust Windows unit / Rust Windows unit and compile (push) Waiting to run
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Waiting to run
CD: Docs MCP Server / build (linux/amd64) (push) Waiting to run
CD: Docs MCP Server / build (linux/arm64) (push) Waiting to run
CD: Docs MCP Server / merge (push) Blocked by required conditions
85 lines
2.8 KiB
Markdown
85 lines
2.8 KiB
Markdown
<div align="center">
|
|
<h1>
|
|
<div class="image-wrapper" style="display: inline-block;">
|
|
<picture>
|
|
<source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.svg" style="display: block; margin: auto;">
|
|
<source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.svg" style="display: block; margin: auto;">
|
|
<img alt="Shows my svg">
|
|
</picture>
|
|
</div>
|
|
|
|
[](#)
|
|
[](#)
|
|
[](https://discord.com/invite/mVnXXpdE85)
|
|
[](https://pypi.org/project/cua-computer/)
|
|
|
|
</h1>
|
|
</div>
|
|
|
|
**Som** (Set-of-Mark) is a visual grounding component for the Computer-Use Agent (Cua) framework powering Cua, for detecting and analyzing UI elements in screenshots. Optimized for macOS Silicon with Metal Performance Shaders (MPS), it combines YOLO-based icon detection with EasyOCR text recognition to provide comprehensive UI element analysis.
|
|
|
|
## Features
|
|
|
|
- Optimized for Apple Silicon with MPS acceleration
|
|
- Icon detection using YOLO with multi-scale processing
|
|
- Text recognition using EasyOCR (GPU-accelerated)
|
|
- Automatic hardware detection (MPS → CUDA → CPU)
|
|
- Smart detection parameters tuned for UI elements
|
|
- Detailed visualization with numbered annotations
|
|
- Performance benchmarking tools
|
|
|
|
## System Requirements
|
|
|
|
- **Recommended**: macOS with Apple Silicon
|
|
- Uses Metal Performance Shaders (MPS)
|
|
- Multi-scale detection enabled
|
|
- ~0.4s average detection time
|
|
- **Supported**: Any Python 3.11+ environment
|
|
- Falls back to CPU if no GPU available
|
|
- Single-scale detection on CPU
|
|
- ~1.3s average detection time
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
# Using PDM (recommended)
|
|
pdm install
|
|
|
|
# Using pip
|
|
pip install -e .
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
```python
|
|
from som import OmniParser
|
|
from PIL import Image
|
|
|
|
# Initialize parser
|
|
parser = OmniParser()
|
|
|
|
# Process an image
|
|
image = Image.open("screenshot.png")
|
|
result = parser.parse(
|
|
image,
|
|
box_threshold=0.3, # Confidence threshold
|
|
iou_threshold=0.1, # Overlap threshold
|
|
use_ocr=True # Enable text detection
|
|
)
|
|
|
|
# Access results
|
|
for elem in result.elements:
|
|
if elem.type == "icon":
|
|
print(f"Icon: confidence={elem.confidence:.3f}, bbox={elem.bbox.coordinates}")
|
|
else: # text
|
|
print(f"Text: '{elem.content}', confidence={elem.confidence:.3f}")
|
|
```
|
|
|
|
## Docs
|
|
|
|
- [Configuration](http://localhost:8090/docs/libraries/som/configuration)
|
|
|
|
## License
|
|
|
|
MIT License - See LICENSE file for details.
|