---
pretty_name: "CodeOCR Dataset (Python Code Images + Ground Truth)"
license: mit
language:
- en
task_categories:
- image-to-text
tags:
- ocr
- code
- python
- leetcode
- synthetic
- computer-vision
size_categories:
- 1K<n<10K
---
# CodeOCR Dataset (Python Code Images + Ground Truth)
This dataset is designed for **Optical Character Recognition (OCR) of source code**.
Each example pairs **Python code (ground-truth text)** with **image renderings** of that code (light/dark themes) and an optional **real photo**.
## Dataset Summary
- **Language:** Python (text ground truth), images of code
- **Splits:** `easy`, `medium`, `hard`
- **Total examples:** 1,000
- `easy`: 700
- `medium`: 200
- `hard`: 100
- **Modalities:** image + text
### What is “ground truth” here?
The `code` field is **exactly the content of `gt.py`** used to generate the synthetic renderings.
During dataset creation, code is normalized to ensure stable GT properties:
- UTF-8 encoding
- n…