{"id":15629748,"url":"https://github.com/gabrielilharco/snap-n-eat","last_synced_at":"2025-04-06T22:08:54.679Z","repository":{"id":80591813,"uuid":"113587999","full_name":"gabrielilharco/snap-n-eat","owner":"gabrielilharco","description":"Food detection and recommendation with deep learning","archived":false,"fork":false,"pushed_at":"2023-03-01T12:07:34.000Z","size":23762,"stargazers_count":286,"open_issues_count":10,"forks_count":74,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-30T20:12:23.410Z","etag":null,"topics":["deep-learning","deep-neural-networks","fastai","flask","food","food-classification","food-recommendation","knn","nodejs","pytorch","resnext"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielilharco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-08T15:23:29.000Z","updated_at":"2025-03-30T19:28:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"48fda092-9e0c-4ccb-afcc-2b7f8bcb0842","html_url":"https://github.com/gabrielilharco/snap-n-eat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielilharco%2Fsnap-n-eat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielilharco%2Fsnap-n-eat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielilharco%2Fsnap-n-eat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielilharco%2Fsnap-n-eat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielilharco","download_url":"https://codeload.github.com/gabrielilharco/snap-n-eat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deep-neural-networks","fastai","flask","food","food-classification","food-recommendation","knn","nodejs","pytorch","resnext"],"created_at":"2024-10-03T10:28:29.946Z","updated_at":"2025-04-06T22:08:54.663Z","avatar_url":"https://github.com/gabrielilharco.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snap \u0026 Eat (formerly deep139)\nDeep Learning Hackathon 48h - Cotidiano (**First place Project =D** )\n\nWe believe nutrition tracking should be as simple as taking a picture.\n\nSnap \u0026 Eat is a web application that tracks the user's food intake by pictures. We use state-of-the-art deep learning techniques to recognize dishes, making instant nutrition estimates from the user's meals.\n\nThe app also suggests meals based on the user's income, and is capable of showing places nearby that serve those dishes.\n\nThe system is implemented in Pytorch using [fastai lib](https://github.com/fastai/fastai), relying on Jupyter Notebooks for prototyping purposes. For the web app, we use Flask and Node.js.\n\n## Demo\n\n![test](data/readme-imgs/app_homescreen.jpg)\n![Alt Text](data/readme-imgs/snap_n_eat.gif)\n\n## Our model\n\nWe use an [Aggregated Residual Convolutional Neural Network](https://arxiv.org/abs/1611.05431) - ResNeXt-101 with 101 layers, pretrained on [ImageNet](http://www.image-net.org/) dataset. We finetune the model on [Food-101 dataset](https://www.vision.ee.ethz.ch/datasets_extra/food-101/), with more than 100 thousand images of 101 types of dishes. We achieve a significant improvement on accuracy (71% in our work compared to 50.1% in [Bossard et al., 2014](http://www.vision.ee.ethz.ch/~lbossard/bossard_eccv14_food-101.pdf)).\n\n![test](data/readme-imgs/food101dataset.png) \n\nFor recomending new dishes, we use minimum distance in an n-dimensional space of nutritional information that describes each dish.\n\n## Installation and usage\n\n### AWS AMI (Amazon Machine Images)\n\nWe provide a ready-to-go AMI of a p2 instance on AWS with all libraries and dependencies installed. \n\n| | | |\n|-|-|-|\n|__AMI ID__| ami-99442ee3 |\n|__AMI Name__| snap-n-eat-ami |\n||||\n\nTo launch an instance based on an AMI, see the [AWS Reference](https://aws.amazon.com/premiumsupport/knowledge-center/launch-instance-custom-ami/). Don't forget to git pull to get the the latest version of the code!\n\n```sh\ncd snapandeat\ngit pull origin master\n```\n \nTo run all the services, the following four comands need to be run in the AWS instance, once in the ```snapandeat``` directory. We recommend using [tmux](https://github.com/tmux/tmux/wiki) to organize the terminals.\n\n```sh\npython src/services/food_predictor.py\n```\n\n```sh\npython src/services/food_descriptor.py\n```\n\n```sh\npython src/services/top_food.py\n```\n\n```sh\nnode src/webapp/server.js\n```\n\nTo view and edit the Jupyter Notebooks, execute:\n\n```sh\ncd /home/ubuntu/snapandeat/src/notebooks\njupyter-notebook --no-browser --ip='*'\n```\n\nThe default password for the notebooks is ```snapneat```. Don't forget to change it!\n\n## About the idea\n\nAccording to the [World Health Organization](http://www.who.int/en/), worldwide obesity has nearly tripled since 1975. In the United States, almost 75% of the population is overweight and more than half of the population is obese ([OECD](http://www.oecd.org/)). Today, many diseases that were preivously thought as hereditary are now shown to be seen conected to biological disfunction related to nutrition.\n\nAlthough being healty and eating better is something the vast majority of the population want, doing so usually requires great effort and organization. The lack of an easy and simple way to track nutrition information about the food you eat can easily lead to low engagement. By providing a very easy and fun way to keep track of what the user eat, we can largely improve engagement, and directly atack on of the largest health problems in the world.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielilharco%2Fsnap-n-eat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielilharco%2Fsnap-n-eat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielilharco%2Fsnap-n-eat/lists"}