Turn photos of paper documents into clean, scanner-quality PDFs — in the browser or from the command line.
Live Demo · How It Works · CLI · Web App
Vertex turns a photograph of a paper document into a flattened, scanner-quality PDF. It detects the page in the frame, corrects perspective distortion, evens out shadows and uneven lighting, and enhances the result to look like it came off an office scanner.
It comes in two forms:
- Web app — drop in one or more photos, scan them, and download the PDFs. Try it instantly, nothing to install.
- Command-line tool — an installable
vertexcommand for full-resolution local scanning with no size limits and the most accurate model.
Important
The demo runs on a free server, so to keep it responsive it uses a lightweight detection model and scales large images down to 1800px. For best results, photograph the page against a plain, uncluttered background. For full-resolution scans and the most accurate model, install the CLI — it runs the full pipeline locally with no size limits.
- Deep-learning document detection — locates the page and its four corners even against complex backgrounds and in uneven lighting
- Perspective correction — flattens the detected page into a clean, rectangular scan of any paper size
- Corner review (web app) — check the detected corners, drag any of them to fix the crop with a live preview, then confirm
- Illumination normalization — evens out shadows and bright spots for a uniform page
- Scanner-style enhancement — pure-white background, crisp ink, and sharpened edges
Input Image
│
▼
Document Detection locate the page and its four corners
│
▼
Perspective Correction warp the page flat
│
▼
Background Trimming remove leftover background around the paper
│
▼
Image Enhancement flatten lighting, whiten the page, sharpen ink
│
▼
PDF Export
On first run, the detection model weights (~5–20 MB) are downloaded automatically and cached locally. Vertex runs fully offline afterward.
The command-line tool gives you the full-quality experience: the most accurate model and no image downscaling.
git clone https://github.com/AdemYahmadi/vertex.git
cd vertex
pipx install .Don't have pipx?
brew install pipx # macOS
pipx ensurepath # then restart your terminalVerify it:
vertex --help# a single image
vertex document.jpg output/
# several images at once
vertex document1.jpg document2.jpg output/
# an entire folder
vertex images/ output/
# any mix of files and folders
vertex a.jpg b.jpg images/ output/Each document is written as its own PDF into the output folder.
Supported formats: .jpg, .jpeg, .png
Prefer to run the web interface yourself?
Backend (from the repository root):
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn api:app --reload --port 8000Frontend (in a second terminal):
cd frontend
npm install
npm run devThen open the printed local URL.
vertex/
├── api.py # FastAPI web service
├── main.py # Command-line entry point
├── src/
│ ├── processor.py # Orchestrates the scanning pipeline
│ ├── core/
│ │ ├── geometry.py # Detection and perspective correction
│ │ └── enhancement.py # Background trimming and enhancement
│ └── utils/
│ └── io.py # Image loading
└── frontend/
└── src/
└── VertexScanner.jsx # The complete web interface
Released under the MIT License.