Skip to main content

Visual trade detection and OCR engine

Project description

Proofreader 🔍

A high-speed vision pipeline for reading Roblox trade screenshots.

PyPI Downloads Python License Build Status GPU YOLOv11

Proofreader transforms unstructured screenshots of Roblox trades ("proofs", hence "proofreader") into structured Python dictionaries. By combining YOLOv11 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

Example

⚡ Performance

Tested on an RTX 5070 using $n=500$ real-world "worst-case" user screenshots (compressed, cropped, and varied UI).

Metric Result (E2E)
Exact Match Accuracy 97.2% (95% CI: 95.4–98.5%)
Median latency 36.8 ms
95th percentile latency 73.4 ms

[!NOTE] End-to-End (E2E) latency includes image loading, YOLO detection, spatial organization, CLIP similarity matching, and OCR fallback.

✨ Key Features

  • Sub-40ms 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-40ms 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 pip command 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:

  1. Detection: YOLOv11 localizes item cards, thumbnails, and robux containers.

  2. Spatial Organization: Assigns child elements (names/values) to parents and determines trade side.

  3. Identification: CLIP performs similarity matching. High-confidence results become Resolved Items immediately.

  4. Heuristic Judge: Low-confidence visual matches trigger OCR and fuzzy-logic reconciliation.

Diagram

📊 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 to yolo.pt and move to src/assets/weights.

🛠️ Tech Stack

  • Vision: YOLOv11 (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

rbx_proofreader-1.1.2.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rbx_proofreader-1.1.2-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file rbx_proofreader-1.1.2.tar.gz.

File metadata

  • Download URL: rbx_proofreader-1.1.2.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rbx_proofreader-1.1.2.tar.gz
Algorithm Hash digest
SHA256 99b4f2b6be3ca95e4833bac07e40929e9c68fe1f94fe9ce8808b0c14ea0f3eb6
MD5 10b521dd2e18f8cb883e4c4ce2cb0b53
BLAKE2b-256 416d3e297ba59a0f9f3874137da79541649ddc443949d82e6c0fa87ea5d7584f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbx_proofreader-1.1.2.tar.gz:

Publisher: publish.yml on lucacrose/proofreader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbx_proofreader-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rbx_proofreader-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15987231d886b386798f8d7228fb965863a5221f7dd0514af2975b030f91b036
MD5 8ce7d53f46bef881de0674733162cde8
BLAKE2b-256 e0ba6f816d43bb6346a5be784e159f6bafb059c6a6160ff2b793a5cca6714f27

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbx_proofreader-1.1.2-py3-none-any.whl:

Publisher: publish.yml on lucacrose/proofreader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page