Skip to content

David031/receipt-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Receipt Extractor

A Python tool for extracting and processing receipts from images. This project provides both a command-line utility and a REST API for background removal and processing of receipt images.

Features

  • Remove backgrounds from receipt images
  • Crop to content boundaries
  • Enhance images for OCR processing
  • Process single images or batches
  • Support for both file-based and base64 image processing
  • REST API with FastAPI

Installation

# Clone the repository
git clone https://github.com/David031/receipt-extractor.git
cd receipt-extractor

# Install dependencies
pip install -r requirements.txt

Usage

Command-line Tool

# Process a single image
python run.py input.jpg output.jpg

# Process with OCR enhancement
python run.py input.jpg output.jpg --enhance

# Process multiple images in a directory
python run.py input_folder/ output_folder/ --batch

API Server

# Start the API server
python run_api.py

The API will be available at http://localhost:8000

API Endpoints

  • GET / - Root endpoint with API information
  • POST /remove-background - Remove background from an uploaded image
  • POST /remove-background-base64 - Remove background from a base64 encoded image
  • POST /batch-process - Process multiple uploaded images
  • POST /batch-process-base64 - Process multiple base64 encoded images
  • GET /health - Health check endpoint
  • GET /metrics - Performance metrics endpoint

Dependencies

  • rembg
  • opencv-python
  • numpy
  • Pillow
  • FastAPI
  • scikit-image
  • PyYAML
  • requests
  • psutil

About

Extract and crop the receipt from the image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages