2-Stage OCR + VLM Stack (~687.6 MB Total) Stage 1: PP-OCRv5 Mobile (21.5 MB CPU WASM) Stage 2: Qwen3.5-0.8B (666.1 MB WebGPU q4f16) Apache-2.0 + Apache-2.0

PP-OCRv5 Mobile OCR → Qwen3.5-0.8B Cross-Verified JSON Extractor

Chain Stage 1: PP-OCRv5 Mobile (PaddlePaddle/PP-OCRv5_mobile_det_onnx + rec_onnx, 21.5 MB CPU WASM, reusing models/pp-ocrv5-mobile/worker.js) directly into Stage 2: Qwen3.5-0.8B (onnx-community/Qwen3.5-0.8B-ONNX, 666.1 MB WebGPU q4f16). Compare raw pixel-only VLM reading side-by-side against OCR-grounded multimodal JSON extraction and audit exact numeric/text anchor recall.

1. Independent Stage Loaders (~687.6 MB Total)

Stage 1 · PP-OCRv5 Mobile (21.5 MB CPU WASM)

Not initialised — reuses ../../pp-ocrv5-mobile/worker.js (Apache-2.0, works on CPU-only browsers).

Stage 2 · Qwen3.5-0.8B (666.1 MB WebGPU q4f16)

Not initialised — uses ../worker.js (Qwen/Qwen3.5-0.8B, Apache-2.0, WebGPU required).

2. Run Deterministic OCR → Raw vs OCR-Grounded VLM Audit

Pick a procedural receipt, invoice, revenue chart, or the zero-person Wikimedia survey chart above, or drop your own PNG/JPEG. Full comparison runs Stage 1 OCR → Raw VLM → OCR-Grounded VLM.

Initialising Stage 1 (PP-OCRv5 Mobile CPU WASM) and Stage 2 (Qwen3.5-0.8B WebGPU) loaders…

Stage 1 OCR Latency–
OCR Lines Detected–
Raw VLM Recall–
Grounded VLM Recall–
Recall Delta–
Grounded JSON Valid–
Stage 2 Speed–
Combined NaN Count–

Stage 1 · PP-OCRv5 DBNet Oriented Boxes

Run Stage 1 to detect oriented text polygons on CPU WASM

Deterministic OCR Lines Passed Into Qwen3.5 Prompt

Stage 1 lines and CTC confidences will appear here.

Stage 2A · Raw Qwen3.5-0.8B (Pixels Only)

Run Full 2-Stage Comparison to see raw pixel-only Qwen3.5-0.8B extraction.

Stage 2B · OCR-Grounded Qwen3.5-0.8B (Pixels + PP-OCRv5)

Run Full 2-Stage Comparison (or Stage 2 Grounded Only) to see OCR-grounded JSON extraction.

Cross-Verification Anchor Audit (Stage 1 OCR Anchors vs Stage 2 Outputs)

Run both stages to inspect exact numeric and token grounding recall.

Show the code

Show the code — qwen35-core.mjs: compareRawVsGroundedExtraction() (OCR anchor recall & JSON cross-verification)