Skip to content

Parser for Images with Ingredients List. Sample for the Google Cloud Vision API.

License

Notifications You must be signed in to change notification settings

irockel/ingredients_parser

Repository files navigation

Nutrition & Ingredients Parser

Small sample application showing the extraction of product information from the ingredient and allergen label on a product packaging using Google Cloud Vision AI. The image needs to be cropped to the ingredient and allergen part of the product packaging. Extraction of the data from a full product back image currently is not supported.

ingredients_scan

Setup

A service account with proper rights to access the Cloud Vision API in a Google Cloud Project is required. Find more about this in the official how to guide.

Place the service account json inside the "ingredients_parser" folder, name it according to the config.py file, the default is vision_service_account.json.

Build & Run

To run the software follow the following steps. There are some test images to use inside the tests/static/cropped_ingredients folder.

Development Setup

To run the parser locally:

pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py

After this navigate with your browser to http://localhost:5000/

Docker

To run it using docker:

docker build -t ingredients-parser .
docker run --name ingredients-parser -p 5000:5000 ingredients-parser

Kubernetes

The tool can also deployment to a kubernetes cluster using the included deploy-ingredients-parser.yaml file.

kubectl apply -f deploy-ingredients-parser.yaml

About

Parser for Images with Ingredients List. Sample for the Google Cloud Vision API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published