ocr / README.md
borreooo's picture
Add HF Spaces config to README
16d34b9
|
Raw
History Blame Contribute Delete
1.67 kB
metadata
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

pip install -r requirements.txt

On Linux you also need:

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

# 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 β†—