A Tensorflow-based ML model for food classification and detection, based on the Kaggle dataset food-101
and thfood-50
- utilizing the InceptionV3
Convolutional Neural Network (CNN) model.
This can be done locally, or via a Cloud serverless provider of your choice. In our case, we used Google Cloud Platform as the main Cloud provider.
- Install
gcloud
CLI and follow the instructions as shown here - Clone this repository and navigate to its root directory
git clone https://github.com/razyoboy/food_for_thoughts/
cd food_for_thoughts
- Deploy to your project by using the following command (more options can be found here)
gcloud run deploy
- Clone this repository and navigate to the root directory
git clone https://github.com/razyoboy/food_for_thoughts/
cd food_for_thoughts
- Ensure all requirements are met
pip install -r requirements.txt
- Run the local server
python -u "src/main.py"
Currently, food_for_thoughts
supports two endpoints:
<base_url>/api/
Returns
{
"status": 200,
"text": "Up and Running!"
}
<base_url>/api/predict-food/
form-data
body withimage-file
as the key- Attach image via the
image-file
key
Returns
{
"status": 200,
"prediction_results": {
"food_type": <food_result>,
"confidence": <percentage>
}
}
DISCLAIMER: This project is part of EGBI443 Image Processing in Medicine class project, and is not intended to be a production ready implementation for food prediction via API calls