This project is an API which provides an endpoint to generate a list of items from an image of a receipt.
- Fork this repository and clone to your local environment.
- Install a version of Python 3 if you do not already have one. I recommend Python 3.8 or newer.
- You can create a virtual environment within Python to create a sandboxed set of package installs. If you already have a preferred method of virtualenv creation, feel free to proceed with your own method.
python -m venv env
- You will need to activate your virtual environment each time you want to work on your project. Run the activate script within the
env/bin
folder that was generated.
To follow this guide, you need to have the OpenCV library installed on your system.
Luckily, OpenCV is pip-installable:
pip install opencv-contrib-python
If you need help configuring your development environment for OpenCV, I highly recommend that you read the pip install OpenCV guide — it will have you up and running in a matter of minutes.
I have provided a requirements.txt
file you can use to install the necessary packages. With your virtualenv activated run: pip install -r requirements.txt
- Follow the instructions on https://docs.docker.com/install/ to install docker
- Follow the instructions on https://docs.docker.com/compose/install/ to install docker compose
- Run
docker compose up
. - docker-compose will install all the packages needed from
requirements.txt
. - The app will run locally at http:https://127.0.0.1:8000.
- Take an image of a receipt and send that image at the following address
http:https://127.0.0.1:8000/get-items
. - List of items will be returned in the response.