A utility for screen parsing and analysis using YOLO and OCR
Project description
MamaSight
MamaSight is a Python package for analyzing images using YOLO object detection and OCR (Optical Character Recognition). It's designed to detect UI elements and text in screenshots and provide annotated visualizations.
Installation
pip install mamasight
Dependencies
MamaSight depends on the following packages:
- torch & torchvision
- ultralytics (v8.3.70)
- numpy (v1.26.4)
- OpenCV
- PaddlePaddle & PaddleOCR (optional for OCR)
- EasyOCR (fallback OCR)
- pandas
Usage
from mamasight import ScreenParser
# Custom box annotation settings (optional)
box_config = {
'box_overlay_ratio': 3200, # Base ratio for scaling
'text_scale': 1.0, # Scale factor for text
'text_thickness': 3, # Thickness of text
'text_padding': 5, # Padding around text
'thickness': 4, # Thickness of bounding boxes
'annotation_style': 'simple', # 'simple' or 'colorful'
}
# Initialize parser with custom settings
parser = ScreenParser(box_config=box_config)
# Setup (will auto-detect GPU/CPU if not specified)
parser.setup(yolo_device='cuda', ocr_device='cuda') # or 'cpu' for CPU
# Analyze image (with or without OCR)
image, detections = parser.analyze('screenshot.png', use_ocr=True)
# Display the annotated image
image.show()
# View detection results as a pandas DataFrame
print(detections)
Features
- Detect UI elements (icons, buttons, etc.) using YOLO
- Optional text detection with OCR
- Customizable annotation styles
- Auto GPU/CPU detection
- Returns both annotated image and structured detection data
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mamasight-0.1.1.tar.gz.
File metadata
- Download URL: mamasight-0.1.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
289d122910f47b89937b315c1724f5865c02daf440b4a6809c9bccadb14fa0bb
|
|
| MD5 |
9c34715ce4d350623f39ef735de97624
|
|
| BLAKE2b-256 |
96dc557e07d4e2ee4faa7e9d4347d52decddfb5283245c8a004038a1fd001020
|
File details
Details for the file mamasight-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mamasight-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b4a3d770e2c43a47e22cb9037e56e99a70ddbd8dfa4d5a590f260f4019967c4
|
|
| MD5 |
e4089d3be8d21cfbb5e02e7bb8a9acea
|
|
| BLAKE2b-256 |
fdbfd3ec44c9c98e23ff27e3904450fb96edf22eb150e3c0880923668ca03866
|