Download scratch/check_ocr.py from Lashtw/idle: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/spaces/Lashtw/idle/resolve/main/scratch/check_ocr.py
- Command line
-
hf download hf://spaces/Lashtw/idle/scratch/check_ocr.py
-
curl -L -o check_ocr.py https://huggingface.co/spaces/Lashtw/idle/resolve/main/scratch/check_ocr.py
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') | |