CalCheck aims to recognize the number of calories associated with an image of food.
This repository contains prototypes for an application developed as part of the requirement for the Interdisciplinary Group Project module at UWE. Prototype versions were based on initial requirement specs and MVP documented in the Blackboard wiki, each version building on its predescessor.
The simplified design is as follows:
A Jupyter notebook with data stored in .csv format, with the ability to determine the number of calories in a hardcoded image using the Google Vision API.
A Jupyter notebook with data stored in a Firebase Firestore db.
A Jupyter notebook with the ability to accept an image from a user (using a file selection iPyWidget) and determine the number of calories in it.
A notebook with a Python API broken out seperately, and automated testing with the ability to scrape a folder of images and determine the calorie counts+accuracy of the labeling.
A simple GUI developed using PySimpleGUI to accept an image from a user and display the number of calories using the API developed in V4. Currently in the mvp_refactored
folder.
- Clone the repo
- Setup Google Cloud Vision locally, set the env variable for authentication - Refer the official tutorial
- Create a
/key
folder in the project root and save the key generated by google vision (.json) - Setup Firebase, add the key to the same
/key
folder. - Add the calorie dataset of your choice into the
/data
folder (ours is titled calorie-dataset.csv, if the name is different, modifymapper_utils
). We used the food-101 calorie dataset from Kaggle). - Run install.py to setup the dependencies.
- Run
mapper_utils.add_data_to_firestore
to upload the data to firebase.
- Run gui.py
- Add images to the /images folder, name them with the expected label (i.e. hamburger.png).
- Run test.py