ECE 570 — Track 2: ProductPrototype
Anonymous Author(s)
SmartReceipt is a prototype system that lets a user upload a restaurant receipt image and automatically extracts:
- Vendor information
- Item names, prices, and quantities
- Beverage types (e.g., soda, alcohol, water)
- Gratuity amount (if present)
The system logs all parsed receipts into a CSV file and generates basic analytics plots for vendor type visits, total spending by vendor type, and beverage spending.
.
├── SmartReceipt.py # Main end-to-end pipeline (OCR + parsing + analytics)
├── parsed_receipts.csv # Database for all input receipts for cumulative analysis
├── requirements.txt # Python dependencies
├── README.md # This file
├── final_t5_base_receipt_parser/# fine-tuned T5-base checkpoint
└── data/
└── README_DATA.md # Notes / instructions for downloading the dataset
This project requires Python 3.9+ and the dependencies listed in requirements.txt.
It is highly recommended to use a virtual environment.
Linux / macOS
python3 -m venv venv
source venv/bin/activateWindows (PowerShell)
python -m venv venv
venv\Scripts\activateAll Python dependencies are listed in the requirements.txt file.
pip install -r requirements.txtThis installs:
- torch — Required for both DocTR and the T5 model
- python-doctr[torch] — OCR engine
- transformers, sentencepiece — T5 model parsing
- pandas, numpy — Data handling
- matplotlib — Plotting
- opencv-python — Image preprocessing
- ...and other utilities.
Tkinter is used for the file dialog (Tk().withdraw() + filedialog.askopenfilename).
Install it if missing:
Ubuntu / Debian
sudo apt-get update
sudo apt-get install python3-tkFedora
sudo dnf install python3-tkintermacOS
- Included with system Python
- For Homebrew Python:
brew install python-tk
Windows
- Comes bundled with standard Python installers
- If missing, reinstall Python from https://www.python.org/downloads/windows/
The fine-tuned parsing model is included in the models/ folder.
Ensure the directory structure matches the repository tree above.
Run the main script:
python SmartReceipt.py- Opens a file dialog window
- User selects a receipt image (
.jpg,.jpeg,.png,.tiff,.bmp) - Script performs:
- DocTR OCR extraction
- T5 receipt parsing
- Extraction (items, prices, quantities, beverage types, gratuity)
- Appends parsed data to
parsed_receipts.csv - Generates analytics plots:
- Vendor type distribution (pie chart)
- Spending by vendor type (bar chart)
- Beverage spending (bar chart)
parsed_receipts.csv: Cumulative log of parsed receipts- Matplotlib window: Visual analytics popup
- Console output: Parsed metadata fields and progress logs
All code contained in this folder was written entirely by the project author for the SmartReceipt system.
No external source code, templates, or previously published implementations were copied or adapted.
Any third-party libraries used (e.g., DocTR, Transformers, PyTorch, OpenCV) are referenced only through their official public APIs.
This codebase represents original work created specifically for this ECE 570 course project.