Added macronutrients for 100 foods #33
mrdbourke
announced in
Announcements
Replies: 2 comments
-
Seems like requirement file is not okay. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes you’re right, the requirements.txt is busted.
I’m in the process of cleaning the repo up now.
It’s a bit of a mess.
Updates to come.
… On 15 Mar 2022, at 7:55 pm, Vineet Singh ***@***.***> wrote:
Seems like requirement file is not okay.
I tried > pip install -r requirements.txt
but it didn't installed all of the libraries which I later installed manually.
—
Reply to this email directly, view it on GitHub <#33 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AD7ZOCOJZVELIBRA3XMBA5DVABNB7ANCNFSM5QUT44HQ>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Nutrify now displays macronutrient information for ~100 foods
When you upload a photo to Nutrify, it now predicts what class of food is in the image and then displays information about that foods macronutrients.
This happens via:
image upload -> computer vision model -> returns class -> class index used to index on a database (hosted on Supabase) -> information from Supabase displayed on homepage
This took a while to happen but I had to learn all about databases (Supabase uses pure PostgreSQL).
The good thing is the app is still fast.
A prediction + query to the database is done in ~0.2-0.5 seconds.
That'll be the peak time I'd like to let it happen in, any longer and the experience won't be as fun.
See the database code in the various JavaScript scripts (I'm new to JS so these are rough):
fdc_id
) live inconstants.js
get_data.js
script.js
supabaseClient.js
- this uses an anon API key, that's apparently "safe to use in public", though I'm not sure what this meansutils.js
Is this how JS projects get laid out?
I have no idea.
It seems to work though.
Issues
No nutrition information for some foods
You might find that ~3/100 foods (like "egg tart") don't show nutrition information.
This is because they don't exist (at least what I've found) in the Food-Central USDA Database (where the rest of the nutrition information comes from).
Data loading is likely not optimal
I'm a newbie to databases.
The speed is how it is now because all of the database rows are loaded when you go to nutrify.app and then they are cached and queried when a prediction is made.
This may not be best practice... but it works.
Ideally, the database would be queried per image classification.
However, I tried this and it takes 1-2 seconds per query (from where I live in Australia because the Supabase database is hosted in the US), this kind of time delay is not acceptable.
Again, queries should happen within a maximum of 0.5 seconds.
The model still does not predict whether there is a food present or not
Future updates will include a food/not food model to see if there's food present in the image or not.
Next
This discussion was created from the release Added macronutrients for 100 foods.
Beta Was this translation helpful? Give feedback.
All reactions