A lightweight, local OCR pipeline designed to convert PDF documents into structured JSON data. This project leverages the LightOn-OCR-1B model running on Ollama for high-accuracy text extraction without data leaving your machine.
maternion/LightOnOCR-2, a vision-language model specialized in document text recognition.uv for lightning-fast dependency management and execution.ollama pull maternion/LightOnOCR-2
# Install uv via curl
curl -LsSf https://astral.sh/uv/install.sh | sh
Using uv, you don't need to manually manage virtual environments or install dependencies one by one.
git clone <your-repo-url>
cd test-lighton-ocr-1b
uv run main.py
uv run pdf.py
Note: uv will automatically handle dependencies (ollama, pypdfium2, requests, pillow) defined in the script or pyproject.toml.
The pipeline follows these steps:
pypdfium2.LightOnOCR-2 vision model via Ollama's Chat API.[
{
"page": 1,
"content": "Full text extracted from page 1..."
},
{
"page": 2,
"content": "Full text extracted from page 2..."
}
]
json ... ) from the response.13 commits
Python
100.0%
A lightweight, local OCR pipeline designed to convert PDF documents into structured JSON data. This project leverages the LightOn-OCR-1B model running on Ollama for high-accuracy text extraction without data leaving your machine.
maternion/LightOnOCR-2, a vision-language model specialized in document text recognition.uv for lightning-fast dependency management and execution.ollama pull maternion/LightOnOCR-2
# Install uv via curl
curl -LsSf https://astral.sh/uv/install.sh | sh
Using uv, you don't need to manually manage virtual environments or install dependencies one by one.
git clone <your-repo-url>
cd test-lighton-ocr-1b
uv run main.py
uv run pdf.py
Note: uv will automatically handle dependencies (ollama, pypdfium2, requests, pillow) defined in the script or pyproject.toml.
The pipeline follows these steps:
pypdfium2.LightOnOCR-2 vision model via Ollama's Chat API.[
{
"page": 1,
"content": "Full text extracted from page 1..."
},
{
"page": 2,
"content": "Full text extracted from page 2..."
}
]
json ... ) from the response.13 commits
Python
100.0%