Skip to content

Calorie detection in food images, completed as part of the requirement from Group 6 for the IGP module.

License

Notifications You must be signed in to change notification settings

nutellaweera/foodie-team-6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foodie-team-6

Screenshot 2022-05-04 at 4 52 53 pm

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:

Screenshot 2022-05-04 at 3 56 01 pm

Version information

V1

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.

V2

A Jupyter notebook with data stored in a Firebase Firestore db.

V3

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.

V4

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.

V5

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.

Setup and run - instructions

Setup

  • 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, modify mapper_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.

To run the GUI (for a single image)

To test/run in bulk

  • Add images to the /images folder, name them with the expected label (i.e. hamburger.png).
  • Run test.py

Sample automated test report: Screenshot 2022-04-25 at 9 48 08 pm

Links and references

About

Calorie detection in food images, completed as part of the requirement from Group 6 for the IGP module.

Resources

License

Stars

Watchers

Forks