Overview
If you already have a printed document (PDF or image), penquify can detect its schema automatically and generate realistic photo variations with ground-truth verification.The Upload Pipeline
1
Upload PDF or image
Provide a file path (CLI/Python) or upload via API.
2
Convert to image
If a PDF, penquify converts the first page to PNG using Playwright.
3
Detect schema
Gemini 2.5 Flash extracts every field: document type, header fields, line items, totals. Returns structured JSON with confidence score.
4
Flatten for verification
The detected schema is flattened to a
field_name -> value dict that serves as ground truth.5
Generate verified photos
Photo variations are generated and verified against the detected schema.
Usage
- CLI
- Python
- API
Detected Schema Format
The vision model returns a structured schema:Output Files
If no presets are specified, the upload pipeline defaults to
full_picture, folded_skewed, and blurry.