AI-powered product label compliance verification. Photograph a package, and VeriPack reads the label, structures every declaration and reports which required fields are missing, malformed or non-compliant.
image → OpenCV preprocessing → Tesseract OCR → Gemini structuring → rules engine → verdict → history
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS, Framer Motion |
| Backend | FastAPI, Pydantic v2 |
| Vision | OpenCV, Tesseract (pytesseract) |
| AI | Gemini (google-generativeai) |
| Storage | MongoDB Atlas (Motor), local JSON store fallback |
Prerequisites: Python 3.10+, Node 20.19+ (22 recommended), and the Tesseract binary:
sudo apt-get install -y tesseract-ocrcd backend
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
cp .env.example .env # optional — see configuration below
.venv/bin/python -m uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run dev # http://localhost:5173, proxies /api and /media to :8000Both external services are optional so the prototype runs with zero credentials:
| Variable | Unset behaviour |
|---|---|
GEMINI_API_KEY |
Falls back to a regex label parser (app/services/heuristics.py) |
MONGODB_URI |
Falls back to a local JSON store at backend/data/scans.json |
GET /api/health reports which backends are active.
| Method | Path | Purpose |
|---|---|---|
POST |
/api/scans |
Multipart image + category → full scan result |
POST |
/api/scans/demo?sample= |
Render a bundled sample label and run the pipeline |
GET |
/api/scans |
Paginated history, filterable by verdict/category |
GET |
/api/scans/{id} |
Full scan detail |
DELETE |
/api/scans/{id} |
Remove a scan |
GET |
/api/rules/categories |
Categories and their required fields |
GET |
/api/samples |
Available demo samples |
GET |
/api/health |
Dependency status |
Rule sets are data, not code: each category is a JSON file in
backend/app/compliance/rules/ declaring its fields, severities, unit constraints and remediation
copy. Adding a category means adding a file. The engine scores a scan by subtracting a
severity-weighted penalty per issue from 100.
- Region grounding — each extracted value is matched back to the OCR word boxes it came from, so the results page can highlight the exact region of the package it was read from.
- Hallucination guard — values are cross-checked against the raw OCR text; anything the model
produced that is not present verbatim is flagged as
ungroundedrather than trusted. - Readability gate — captures below a word-count and OCR-confidence floor are rejected with retake guidance instead of returning confident nonsense.
cd backend && .venv/bin/python -m pytest tests -qCompliance results are indicative and not legal advice.