- 源码 316 文件收编为 rusto-rs/ 文件夹,随本仓库管理 - 移除内部 .git(补丁已存档 docs/rusto-rs-metal-patch-20260912.patch,上游可随时 re-clone) - target/ 与 docs/.yarn 缓存不入库;本地改动:ROCR_* 环境变量调优 + Metal 链接修复 + 预处理测试脚本
22 lines
680 B
Python
22 lines
680 B
Python
#!/usr/bin/env python3
|
|
"""Test with PaddleOCR official implementation"""
|
|
from paddleocr import PaddleOCR
|
|
import sys
|
|
|
|
# Initialize OCR
|
|
print("Initializing PaddleOCR...")
|
|
ocr = PaddleOCR(use_textline_orientation=False, lang='en')
|
|
|
|
# Run OCR
|
|
image_path = sys.argv[1] if len(sys.argv) > 1 else 'models/test_images/example1.png'
|
|
print(f"\nProcessing: {image_path}")
|
|
result = ocr.predict(image_path)
|
|
|
|
# Print results
|
|
print(f"\nResult type: {type(result)}")
|
|
print(f"Result structure: {result}")
|
|
if isinstance(result, dict) and 'ocr_text' in result:
|
|
print(f"\nOCR Text: {result['ocr_text']}")
|
|
elif isinstance(result, list) and len(result) > 0:
|
|
print(f"\nFirst item: {result[0]}")
|