Recipify is a powerful receipt data extraction tool that combines YOLO11 for object detection and Tesseract OCR for text recognition. It automatically extracts key information from receipt images, such as vendor names, total amounts, items, and dates, to help you keep track of your expenses.
- YOLO11 Object Detection: Detects receipt elements like shop names, total amounts, dates, and items.
- Tesseract OCR: Extracts textual data from the receipt images.
- Advanced Preprocessing: Enhances image quality for better OCR and object detection.
- Dataset Conversion: Converts annotated receipt datasets into YOLO format for training.
- CLI Support: Easy-to-use command-line interface for running the demo.
git clone https://github.com/subhashhhhhh/Recipify.git
cd Recipify
Create and activate a Python virtual environment:
python -m venv recipify_env
source recipify_env/bin/activate # On Windows: recipify_env\Scripts\activate
Install the project and its dependencies:
pip install -e .
To process a receipt image and extract details:
recipify-demo --image <path_to_receipt_image> --weights <path_to_yolo_weights>
Example:
recipify-demo --image example_receipt.jpg --weights yolo11n.pt
If you want to train YOLO11 on a custom dataset:
-
Ensure your dataset is structured as follows:
dataset/ ├── train/ │ ├── images/ │ └── labels/ ├── val/ │ ├── images/ │ └── labels/
-
Update
dataset.yaml
:train: dataset/train/images val: dataset/val/images nc: 5 names: ['shop', 'item', 'total', 'date_time', 'receipt']
-
Train the model:
python -m ultralytics.yolo train --data dataset.yaml --weights yolo11n.pt --epochs 50
Recipify/
├── recipify/
│ ├── __init__.py
│ ├── preprocessing.py # Image preprocessing for OCR
│ ├── ocr.py # Text extraction using Tesseract
│ ├── classification.py # Receipt type classification
│ ├── extraction.py # Data parsing and extraction
│ ├── dataset_processing.py # Convert annotations to YOLO format
│ ├── train.py
│ ├── dataset.yaml
├── dataset/ # Custom dataset (images and labels)
├── requirements.txt # Python dependencies
├── setup.py # Installation configuration
└── README.md # Project documentation
- Run tests with
pytest
:pytest
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m "Add a new feature"
- Push the branch:
git push origin feature-branch
- Open a pull request.
- Python 3.9+
- YOLO11: Ultralytics for object detection.
- Tesseract OCR: For text extraction.
- SpaCy: For named entity recognition (NER).
- OpenCV: For image preprocessing.
Install all dependencies via:
pip install -r requirements.txt
- Ultralytics: For the YOLO11 model.
- Google: For Tesseract OCR.
- OpenCV: For powerful image processing capabilities.
- Community: For contributing open datasets for receipts.
This project is licensed under the MIT License.