FoodLord - HackCU 2019
Food Lord
🥑 You don’t need a maths degree for counting calories.
Inspiration
Have you ever thought about what are you really eating? Maybe no. Are you too lazy for counting calories and for monitoring if you exceed the limit? Maybe yes. Here is where Food Lord borns. An application that allows you to take a picture and automagically know what are you gonna eat!
What it does
Our web app allows you to estimate how many calories and which ingredients there are in the picture that you sent to the application. In order to do that, you only have to create an account and then take a picture or upload an image.
We know that this magic process could have bad results or ingredients that there aren’t in the given image. In order to solve that, we’ve added a feature that allows you to add and remove ingredients to the processed image.
Finally, the app will save this data (known as a report) and they will be available to check in the user dashboard, where you can have a quick look about how you have been eating during the current week.
How we built it
Frontend and backend are very different components connected by API requests.
At frontend, we can see a React application that uses the library Grommet in order to use the UI components and integrated into a Docker compose.
In the other side of the application, we have the backend which is implemented with Python 3.6+. For creating the API that allows the communication between the two components, we have used Flask and OpenAPI (connected themselves with Connexion library), also integrated with Docker compose.
The core of the application, which allows us to estimate the calories and ingredients of a given image, has been possible thanks to RapidAPI. Food Lord is using these three APIs:
- Imagga: this API allows us to use a Computer vision segmentation model for tagging all the objects that we get from the image. We also filter these tags using a threshold of 0.35 (35%).
- Recipe: this API allows for getting all the ingredients from a huge database. This permits us to filter the results that we got from Imagga Image Recognition API.
- Nutritionix: this API allows us to get all the information related to calories. Given a list of ingredients, we can get an estimation of how many calories have those ingredients.
This aggregation of APIs (called Food Lord API) has been deployed and exposed in the RapidAPI Marketplace, where you can test with an Internet-accessible image URL.
All this system is finally deployed in a Google Cloud VM and hosted in a free .tk domain.
Challenges we ran into
Since we have never used the kind of technology we needed to do a deep research in order to find the APIs to use with RapidAPI. Also we have found some problems when we were coding the fronted because we used a new library for us – Grommet components.
However, the most challenging part was deploying the web in Google Cloud Platform since a lot of ports of the Wi-Fi were blocked.
Accomplishments that we’re proud of
We are proud of the project that we built. We have developed all the web app faster than we actually expected so we can take special care of a good UX experience and reach the objectives that we have.
What we learned
We learned a lot using the RapidAPI and discovering the huge amount of APIs that we have at our disposal. Also, regarding the front-end part, we learned a lot using Grommet, which is a React library.
What’s next for Food Lord
There are a lot of enhancements and next steps that Food Lord could have. But, for example, could be interesting to share the meals and their estimations with the user dietist so he/she could help the user to be even healthier.
Requirements
- docker-compose
Usage
To run the whole stack, please execute the following from the root directory:
Run the server as a docker container
# with docker-compose docker-compose up -d --build # with a bash script source run.sh
Authors
License
MIT © Food Lord