Converts handwritten PDF notes into clean Markdown, with automatic figure/diagram extraction.
Python 3.12
pdf2image for PDF rendering
sudo apt install poppler-utilssudo pacman -S popplerbrew install popplerollama pull qwen3-vlInstall all Python dependencies:
pip install -r requirements.txt
Key packages:
| Package | Purpose |
|---|---|
torch, torchvision | PyTorch backend (CUDA) |
transformers | Florence-2 model for figure detection & verification |
timm, einops | Required by Florence-2 architecture |
ultralytics | YOLOv12 DocLayNet for layout detection |
huggingface_hub | Model downloading (YOLO weights, Florence-2) |
ollama | Qwen3-VL for handwritten text OCR |
opencv-python | Image preprocessing (CLAHE, thresholding, denoising) |
pdf2image | PDF page to image conversion |
pillow | Image handling |
tqdm | Progress bars |
numpy | Array operations |
| Model | Source | Size | Purpose |
|---|---|---|---|
| YOLOv12m-DocLayNet | hantian/yolo-doclaynet | ~50MB | Fast layout detection (pass 1) |
| Florence-2-base | microsoft/Florence-2-base | ~0.5GB | Figure detection, verification & crop refinement (pass 2) |
| Qwen3-VL | Ollama (qwen3-vl) | ~5GB | Handwritten text OCR |
./test/python main.py
./test_out/Converts handwritten PDF notes into clean Markdown, with automatic figure/diagram extraction.
Python 3.12
pdf2image for PDF rendering
sudo apt install poppler-utilssudo pacman -S popplerbrew install popplerollama pull qwen3-vlInstall all Python dependencies:
pip install -r requirements.txt
Key packages:
| Package | Purpose |
|---|---|
torch, torchvision | PyTorch backend (CUDA) |
transformers | Florence-2 model for figure detection & verification |
timm, einops | Required by Florence-2 architecture |
ultralytics | YOLOv12 DocLayNet for layout detection |
huggingface_hub | Model downloading (YOLO weights, Florence-2) |
ollama | Qwen3-VL for handwritten text OCR |
opencv-python | Image preprocessing (CLAHE, thresholding, denoising) |
pdf2image | PDF page to image conversion |
pillow | Image handling |
tqdm | Progress bars |
numpy | Array operations |
| Model | Source | Size | Purpose |
|---|---|---|---|
| YOLOv12m-DocLayNet | hantian/yolo-doclaynet | ~50MB | Fast layout detection (pass 1) |
| Florence-2-base | microsoft/Florence-2-base | ~0.5GB | Figure detection, verification & crop refinement (pass 2) |
| Qwen3-VL | Ollama (qwen3-vl) | ~5GB | Handwritten text OCR |
./test/python main.py
./test_out/