--- title: Chassis OCR emoji: 🔧 colorFrom: blue colorTo: green sdk: docker pinned: false --- # Chassis OCR Pipeline Reads engraved chassis numbers from phone images and matches them against barcode-scanned numbers. ## Setup ```bash pip install -r requirements.txt ``` On Linux you also need: ```bash sudo apt-get install libzbar0 ``` ## Project Structure ``` chassis_ocr/ ├── images/ │ ├── barcode/ ← put your 50 barcode images here │ └── chassis/ ← put your 50 chassis images here (same filenames) ├── results/ ← comparison images + report saved here ├── preprocess.py ← image cleaning pipeline ├── barcode_scanner.py ├── ocr.py └── evaluate.py ← run this ``` ## Important — Naming Convention Barcode and chassis images must have the **same filename** to be paired: ``` images/barcode/001.jpg ←→ images/chassis/001.jpg images/barcode/002.jpg ←→ images/chassis/002.jpg ``` ## Run ```bash # Test preprocessing on a single chassis image python preprocess.py images/chassis/001.jpg # Test OCR on a single chassis image python ocr.py images/chassis/001.jpg # Run full evaluation on all 50 pairs python evaluate.py ``` ## Output After running `evaluate.py`: - `results/report.json` — full accuracy breakdown - `results/*_comparison.jpg` — before/after preprocessing for each image ## Pipeline ``` Barcode image → pyzbar → ground truth string ↘ Chassis image → CLAHE → Adaptive threshold Compare → ✅ Match / ❌ Mismatch → Morphological ops → PaddleOCR ↗ ```