--- license: odc-by tags: - ocr - benchmark - pdf - document-understanding language: - en pretty_name: olmOCR-bench Pre-Rendered size_categories: - 1K, 'pdf_stem': '...', 'category': '...', ...} ``` ## Contents | Directory | Contents | Count | |-----------|----------|-------| | `images/` | Pre-rendered PNG images (page 1, 2048px longest dim) with `metadata.jsonl` per category | 1,403 images | | `ground_truth/` | JSONL test case files (from allenai/olmOCR-bench) | 7,010 tests | | `predictions/` | Published model prediction caches | 1,403 .md files | ## Rendering Details Each PDF page is rendered to PNG matching the official olmOCR benchmark process: - **Resolution**: `target_longest_image_dim = 2048` (longest side scaled to 2048px, aspect ratio preserved) - **Renderer**: PyMuPDF (same pixel output as pdftoppm used in the official repo) - **Pages**: Page 1 only (the benchmark tests only page 1 of each PDF) - **Naming**: `{pdf_stem}_pg1.png` This matches what the official benchmark runners do internally: - `run_chatgpt.py`: `render_pdf_to_base64png(pdf_path, target_longest_image_dim=2048)` - `run_claude.py`: `render_pdf_to_base64png(pdf_path, target_longest_image_dim=2048)` - `run_gemini.py`: `render_pdf_to_base64png(pdf_path, target_longest_image_dim=2048)` - `run_server.py`: `render_pdf_to_base64png(pdf_path, target_longest_image_dim=1024)` (for smaller models) ## Quick Start Evaluate any model with zero setup: ```bash pip install litellm httpx # Run on any litellm-supported model python run_bench.py --model gpt-4o python run_bench.py --model claude-sonnet-4-20250514 python run_bench.py --model gemini/gemini-2.0-flash # Run specific categories only python run_bench.py --model gpt-4o --categories arxiv_math headers_footers # Evaluate published predictions (no API key needed) python run_bench.py --evaluate nanonets-optimal-v4 ``` ## Direct File Access Every file is accessible via URL: ``` https://huggingface.co/datasets/shhdwi/olmocr-pre-rendered/resolve/main/images/arxiv_math/2503.05390_pg14_pg1.png https://huggingface.co/datasets/shhdwi/olmocr-pre-rendered/resolve/main/ground_truth/arxiv_math.jsonl ``` ## Attribution Based on [olmOCR-bench](https://huggingface.co/datasets/allenai/olmOCR-bench) by Allen AI ([paper](https://huggingface.co/papers/2502.18443)). Licensed ODC-BY-1.0.