ocr-super-surya
38
总安装量
38
周安装量
#5479
全站排名
安装命令
npx skills add https://github.com/aktsmm/agent-skills --skill ocr-super-surya
Agent 安装分布
openclaw
23
claude-code
21
opencode
19
codex
15
gemini-cli
13
cursor
13
Skill 文档
OCR Super Surya
GPU-optimized OCR using Surya.
When to Use
- OCR, extract text from image, text recognition, ç»åããæå
- Extracting text from screenshots, photos, or scanned images
- Processing PDFs with embedded images
- Multi-language document OCR (90+ languages including Japanese)
Features
| Feature | Description |
|---|---|
| Accuracy | 2x better than Tesseract (0.97 vs 0.88) |
| GPU | PyTorch-based, CUDA optimized |
| Languages | 90+ including CJK |
| Layout | Document layout, table recognition |
Quick Start
Installation
# 1. Check GPU
python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}')"
# 2. Install (with CUDA if GPU available)
pip install surya-ocr
# If CUDA=False but you have GPU, reinstall PyTorch:
pip uninstall torch torchvision torchaudio -y
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Usage
# CLI
python scripts/ocr_helper.py image.png
python scripts/ocr_helper.py document.pdf -l ja en -o result.txt
# Or use surya directly
surya_ocr image.png --output_dir ./results
Python API
from PIL import Image
from surya.recognition import RecognitionPredictor
from surya.detection import DetectionPredictor
from surya.foundation import FoundationPredictor
image = Image.open("document.png")
found_pred = FoundationPredictor()
rec_pred = RecognitionPredictor(found_pred)
det_pred = DetectionPredictor()
for page in rec_pred([image], det_predictor=det_pred):
for line in page.text_lines:
print(line.text)
GPU Configuration
| Variable | Default | Description |
|---|---|---|
RECOGNITION_BATCH_SIZE |
512 | Reduce for lower VRAM |
DETECTOR_BATCH_SIZE |
36 | Reduce if OOM |
export RECOGNITION_BATCH_SIZE=256
surya_ocr image.png
Scripts
| Script | Description |
|---|---|
scripts/ocr_helper.py |
Helper with OOM auto-retry, batch support |
License Note
- Surya: GPL-3.0 (code), commercial license required for >$2M revenue