- Take a picture of the ingredients that you have or upload a picture
- Detect the food
- See what is detected, add changes as needed
- Get recipes
- See recipes and choose from 10 max
- Repeat!
- Backend Stack: Flask, Celery, Redis
- The Flask backend is implemented asynchronously to accommodate for heavy traffic.
- Use of task IDs and interval function calls are used to track status/result
- Use initial AJAX call to get the task ID
- At interval, use another AJAX call using the task ID to grab status
- End interval checking once AJAX call responds with success/failure
- The test react app demonstrates how to properly use the Flask backend
- Object detection model based on images from the internet, labeled by Christian
- Mimics the general workflow of a ML software developer developing on Tensorflow
- Backend:
- flask
- celery
- openCV
- OpenVINO 2019 R1.1
- numpy
- base64
- PIL.Image
- io
- redis
- Frontend:
- React dependencies
- axios
- react-webcam
- pip3 or pip install all the python dependencies for the backend
- Set up redis by following the installation in the backend setup section.
npm install
in thetest_react_app
folder to install all the dependencies for the react app.- Download weights for food model and gesture model
- In the case that you don't like my models, please feel free to train your own models and plug them into the app. My recommendation is to follow the tutorial links below to train using Tensorflow's Object Detection API.
- open four terminals
- first terminal ->
$ redis-server
- second terminal ->
$ cd <INSTALL_DIR>/devmesh_backend/ && celery worker -A openvino_backend.celery --loglevel=info
- third terminal ->
python3 openvino_backend.celery
- Make a config.js file and add the necessary requirements such as app_id, app_key, and Raspberry Pi backend url.
- fourth terminal ->
cd <INSTALL_DIR>/devmesh_backend/test_react_app && npm start
- Make an account on dataplicity and go through their tutorial to setup your raspberry pi for access via the internet
- Use the special url and copy and paste that into the first key
BACKEND_URL
- Go to Edamam API's website and register for an account. You will need to sign up for their recipe API as well as make an application that uses the recipe API.
- Copy the app ID and app key into the remaining key-value pairs, respectively
- Dealing with ELIFECYCLE Errors?
sudo npm cache clean --force
sudo rm -rf node_modules
sudo npm install --save
npm start
- Dealing with modules not being found?
- Pay attention to what you used to install dependencies. Pip and pip3 might not install to the python you might be expecting. In addition, using sudo rather --user may also lead to some referencing problems. Make sure to stay consistent!
- https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html
- https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
- EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#184
- ???