toshisakao/handwritten_to_md

Python

0

8 commits

updated Feb 16, 2026

See the code

README

handwritten_to_md

Converts handwritten PDF notes into clean Markdown, with automatic figure/diagram extraction.

Python 3.12

Dependencies

System

  • poppler - required by pdf2image for PDF rendering
    • Ubuntu/Debian: sudo apt install poppler-utils
    • Arch: sudo pacman -S poppler
    • macOS: brew install poppler
  • Ollama - local LLM runtime for OCR (text transcription)
  • NVIDIA GPU with CUDA support (tested on RTX 3070 Ti 8GB)

Python

Install all Python dependencies:

pip install -r requirements.txt

Key packages:

PackagePurpose
torch, torchvisionPyTorch backend (CUDA)
transformersFlorence-2 model for figure detection & verification
timm, einopsRequired by Florence-2 architecture
ultralyticsYOLOv12 DocLayNet for layout detection
huggingface_hubModel downloading (YOLO weights, Florence-2)
ollamaQwen3-VL for handwritten text OCR
opencv-pythonImage preprocessing (CLAHE, thresholding, denoising)
pdf2imagePDF page to image conversion
pillowImage handling
tqdmProgress bars
numpyArray operations

Models (downloaded automatically on first run)

ModelSourceSizePurpose
YOLOv12m-DocLayNethantian/yolo-doclaynet~50MBFast layout detection (pass 1)
Florence-2-basemicrosoft/Florence-2-base~0.5GBFigure detection, verification & crop refinement (pass 2)
Qwen3-VLOllama (qwen3-vl)~5GBHandwritten text OCR

Usage

  1. Place PDF files in ./test/
  2. Run:
python main.py
  1. Output Markdown and extracted figures are saved to ./test_out/

toshisakao/handwritten_to_md

Python

0

8 commits

updated Feb 16, 2026

See the code

README

handwritten_to_md

Converts handwritten PDF notes into clean Markdown, with automatic figure/diagram extraction.

Python 3.12

Dependencies

System

  • poppler - required by pdf2image for PDF rendering
    • Ubuntu/Debian: sudo apt install poppler-utils
    • Arch: sudo pacman -S poppler
    • macOS: brew install poppler
  • Ollama - local LLM runtime for OCR (text transcription)
  • NVIDIA GPU with CUDA support (tested on RTX 3070 Ti 8GB)

Python

Install all Python dependencies:

pip install -r requirements.txt

Key packages:

PackagePurpose
torch, torchvisionPyTorch backend (CUDA)
transformersFlorence-2 model for figure detection & verification
timm, einopsRequired by Florence-2 architecture
ultralyticsYOLOv12 DocLayNet for layout detection
huggingface_hubModel downloading (YOLO weights, Florence-2)
ollamaQwen3-VL for handwritten text OCR
opencv-pythonImage preprocessing (CLAHE, thresholding, denoising)
pdf2imagePDF page to image conversion
pillowImage handling
tqdmProgress bars
numpyArray operations

Models (downloaded automatically on first run)

ModelSourceSizePurpose
YOLOv12m-DocLayNethantian/yolo-doclaynet~50MBFast layout detection (pass 1)
Florence-2-basemicrosoft/Florence-2-base~0.5GBFigure detection, verification & crop refinement (pass 2)
Qwen3-VLOllama (qwen3-vl)~5GBHandwritten text OCR

Usage

  1. Place PDF files in ./test/
  2. Run:
python main.py
  1. Output Markdown and extracted figures are saved to ./test_out/