idle / scratch /check_ocr.py
Lashtw's picture
Upload 1992 files
4bba76c verified
Raw History Blame Contribute Delete
538 Bytes
import json
import os
import sys
sys.stdout.reconfigure(encoding='utf-8')
def inspect_page(path):
if not os.path.exists(path):
print(f"File not found: {path}")
return
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
print(f"=== {os.path.basename(path)} ({len(data)} items) ===")
for item in data[:25]:
print(f"[{item['box'][1]:4.0f}] {item['text']}")
inspect_page('scratch/ocr/A/p008.json')
inspect_page('scratch/ocr/A/p014.json')
inspect_page('scratch/ocr/A/p020.json')