How vimarsh244/scanclean works
ScanClean cleans decoded scanned-page pixels conservatively, preserving text while removing document defects. Its primary workflow is either a Python caller supplying an image or the desktop CLI decoding PDF pages; both invoke the core cleaner, which analyzes and removes defects before returning cleaned pixels and optional audit data. The CLI then writes cleaned PDFs. Documented options include deskewing, text-detector guidance, transparency, bilevel output, and audit overlays. The bundled ONNX detector is documented, but its core integration call is not visible in the partial excerpt; that link is therefore shown as unverified.
Main entry points: core.py Page cleaner · cli.py Desktop CLI · __init__.py Python API · ppocrv6_tiny_det.onnx ONNX text detector
Components 14
User interfaces
- Python API
src/scanclean/__init__.py - Desktop CLI
src/scanclean/cli.py - PDF page decoding
src/scanclean/cli.py
Cleaning pipeline
- Page cleaner
src/scanclean/core.py - Page analysis
src/scanclean/core.py - Defect removal stages
src/scanclean/core.py - ONNX text detector
src/scanclean/models/ppocrv6_tiny_det.onnx
Output and review
- PDF encoding
src/scanclean/core.py - Audit overlay PDF
src/scanclean/cli.py - Cleaned PDF
- Cleaned pixels
Other components
- Python caller
- CLI user
- Input PDFs
Connections 14
- Python caller → Python API: supplies pixels
README.md - Python API → Page cleaner: calls
src/scanclean/__init__.py - CLI user → Desktop CLI: runs
README.md - Input PDFs → PDF page decoding: provides pages
src/scanclean/cli.py - Desktop CLI → PDF page decoding: decodes pages
src/scanclean/cli.py - PDF page decoding → Page cleaner: passes pixels
src/scanclean/cli.py - Desktop CLI → Page cleaner: cleans pages
src/scanclean/cli.py - Page cleaner → Page analysis: analyzes page
README.md - Page analysis → Defect removal stages: removes defects
README.md - Page cleaner → ONNX text detector: consults optionally
- Page cleaner → Cleaned pixels: returns result
README.md - Desktop CLI → PDF encoding: writes pages
src/scanclean/cli.py - PDF encoding → Cleaned PDF: produces
README.md - Desktop CLI → Audit overlay PDF: writes optionally
src/scanclean/cli.py