Visual trade detection and OCR engine
Project description
Proofreader 🔍
A high-speed vision pipeline for reading Roblox trade screenshots.
Proofreader transforms unstructured screenshots of Roblox trades ("proofs", hence "proofreader") into structured Python dictionaries. By combining YOLO26 for object detection, CLIP for visual similarity, and EasyOCR, it achieves high accuracy across diverse UI themes, resolutions, and extensions.
Why Proofreader?
Roblox trade screenshots are commonly used as proof in marketplaces, moderation workflows, and value analysis, yet they are manually verified and error-prone. Proofreader automates this process by converting screenshots into structured, verifiable data in milliseconds.
Example
⚡ Performance
Tested on an RTX 5070 using $n=1300$ real-world "worst-case" user screenshots (compressed, cropped, and varied UI).
| Metric | Result (E2E) |
|---|---|
| Exact Match Accuracy | 98.4% (95% CI: 97.5–99.0%) |
| Median latency | 28.0 ms |
| 95th percentile latency | 47.4 ms |
[!NOTE] Latencies above are reported End-to-End (E2E), including image loading, YOLO detection, spatial organization, CLIP matching, and OCR fallback. If passing images directly as NumPy arrays, median latency is 20.5 ms (35.0 ms P95).
✨ Key Features
-
Sub-30ms Latency: Optimized with "Fast-Path" logic that skips OCR for high-confidence visual matches, ensuring near-instant processing.
-
Multi-modal decision engine: Weighs visual embeddings against OCR text to resolve identities across 2,500+ distinct item classes.
-
Fuzzy Logic Recovery: Built-in string distance matching corrects OCR typos and text obscurations against a local asset database.
-
Theme & Scale Agnostic: Robust performance across various UI themes (Dark/Light), resolutions, and custom display scales.
💻 Quick Start
Installation
pip install rbx-proofreader
[!IMPORTANT] Hardware Acceleration: Proofreader automatically detects NVIDIA GPUs. For sub-30ms performance, ensure you have the CUDA-enabled version of PyTorch installed. If a CPU-only environment is detected on a GPU-capable machine, the engine will provide the exact
pipcommand to fix your environment.
Usage
import proofreader
# Extract metadata from a screenshot
data = proofreader.get_trade_data("trade_proof.png")
print(f"Items Out: {data['outgoing']['item_count']}")
print(f"Robux In: {data['incoming']['robux_value']}")
[!TIP] First Run: On your first execution, Proofreader will automatically download the model weights and item database (~360MB). Subsequent runs will use the local cache for maximum speed.
🧩 How it Works
The model handles the inconsistencies of user-generated screenshots (varied crops, UI themes, and extensions) through a multi-stage process:
-
Detection: YOLO26 localizes item cards, thumbnails, and robux containers.
-
Spatial Organization: Assigns child elements (names/values) to parents and determines trade side.
-
Identification: CLIP performs similarity matching. High-confidence results become Resolved Items immediately.
-
Heuristic Judge: Low-confidence visual matches trigger OCR and fuzzy-logic reconciliation.
📊 Data Schema
The get_trade_data() function returns a structured dictionary containing incoming and outgoing trade sides.
| Key | Type | Description |
|---|---|---|
item_count |
int |
Number of distinct item boxes detected. |
robux_value |
int |
Total Robux parsed from the trade. |
items |
list |
List of ResolvedItem objects containing id and name. |
ResolvedItem Schema:
| Property | Type | Description |
|---|---|---|
id |
int |
The official Roblox Asset ID. |
name |
str |
Canonical item name from the database. |
🏗️ Development & Training
To set up a custom training environment for the YOLO and CLIP models:
# 1. Clone and Install
git clone https://github.com/lucacrose/proofreader.git
cd proofreader
pip install -e ".[train]"
# 2. Initialize Database
python scripts/setup_items.py
# 3. Training
# Place backgrounds in src/proofreader/train/emulator/backgrounds
# Place HTML templates in src/proofreader/train/emulator/templates
python scripts/train_models.py
[!CAUTION] GPU Required: Training is not recommended on a CPU. Final models save to
runs/train/weights/best.pt. Rename toyolo.ptand move tosrc/assets/weights.
🛠️ Tech Stack
- Vision: YOLO26 (Detection), CLIP (Embeddings), OpenCV (Processing)
- OCR: EasyOCR
- Logic: RapidFuzz (Fuzzy String Matching)
- Core: Python 3.12, PyTorch, NumPy
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request.
📜 License
This project is licensed under the MIT License.
Project details
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 rbx_proofreader-1.2.0.tar.gz.
File metadata
- Download URL: rbx_proofreader-1.2.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42be06d704456d2fbee5f6d4e4f9ec437f199a5b5560b8752e99c519c5157050
|
|
| MD5 |
44532989a4d477ea69804285a4c00242
|
|
| BLAKE2b-256 |
d57529e5337c05e1794251c765735b586317d57432ad28d5aaa6ec65b12d70aa
|
Provenance
The following attestation bundles were made for rbx_proofreader-1.2.0.tar.gz:
Publisher:
publish.yml on lucacrose/proofreader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rbx_proofreader-1.2.0.tar.gz -
Subject digest:
42be06d704456d2fbee5f6d4e4f9ec437f199a5b5560b8752e99c519c5157050 - Sigstore transparency entry: 922806086
- Sigstore integration time:
-
Permalink:
lucacrose/proofreader@b82c20d92c4e00de073bf1153ae2bfa1438a26d0 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/lucacrose
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b82c20d92c4e00de073bf1153ae2bfa1438a26d0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rbx_proofreader-1.2.0-py3-none-any.whl.
File metadata
- Download URL: rbx_proofreader-1.2.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7ffdd1814a1fd8001bb3ac11d437323f5d6e9fab20e3cb27c0a69d5417b3073
|
|
| MD5 |
91c731a7e5782f8f4c87d14f7fadaeb6
|
|
| BLAKE2b-256 |
35fad24a39b2f10bf069e8057cae030021f2c73b0b067447d22fda8381ad2377
|
Provenance
The following attestation bundles were made for rbx_proofreader-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on lucacrose/proofreader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rbx_proofreader-1.2.0-py3-none-any.whl -
Subject digest:
d7ffdd1814a1fd8001bb3ac11d437323f5d6e9fab20e3cb27c0a69d5417b3073 - Sigstore transparency entry: 922806118
- Sigstore integration time:
-
Permalink:
lucacrose/proofreader@b82c20d92c4e00de073bf1153ae2bfa1438a26d0 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/lucacrose
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b82c20d92c4e00de073bf1153ae2bfa1438a26d0 -
Trigger Event:
release
-
Statement type: