0:00 and we're on te boom we're on going live yeah yeah yeah yeah okay maybe I start with just just my face there we go okay we're in if you're in the chat let me know if you can see me let me know if you can hear me because we have a very exciting stream today we're celebrating 100,000 subscribers which is an insane amount yo yo yo let me know if you can hear see all good hello everyone welcome welcome welcome I like your T-shirt thank you Oscar perfect sound beautiful beautiful beautiful and what about the screen if I put the screen on here let's get some code can you see this all right because we're going to be going for 10 hours and I would hate for people not to be able to see so let me know if you can see what's happening 1:02 sound like a fellow Aussie yes yes yes movember mustache I do have a movember mustache we can hear and see very quick clearly amazing okay for me YouTube is looking good let's get started first what we're going to do is we need to lay out some ground rules for the stream so welcome everyone I have no idea how this is going to turn out 10 hours is a long time uh but not really because it's only really just a day so let's go over here and we will get page title is It's November the 6th where I live it is 8 a.m. in the beautiful Northern beaches of Brisbane so I can't show you it but I have the beautiful water there you can see the trees the water the sky it's good it's a good day November 6 100K live stream 2:02 celebration the editor is a bit small I'll increase that okay so what about this how's the size there is that a good size for the 2:25 editor it's afternoon in the real world 11:00 p.m. in France hello everyone everyone leave their country flag in the chat let's see how many different countries we have okay so that's that's good that's where we're going to go okay and now let's go here how do I zoom in zoom in zoom we're just going to use notion actually notion add to uh that way you guys can see what's going on as well November 6 100K live stream celebration look at that I can't even zoom in openers page we're on okay so let's add a little icon we can go party okay you can all see this here's what we're going to do today so we need 3:26 to lay out some rules we've got plenty of time so we're not going to rush rules so every hour equals 10 push-ups 10 situps no 10 squats and let's go 10 kicks 10 punches that way we got to keep moving all right and then let's go surprises at 77 minutes in and then that's about it for the timing wise so let's set a timer there's going to be a surprise at 77 minutes in everyone we're going to set a timer timer 77 minutes oh 77 minutes and 77 seconds let's do that okay so there's surprises when this timer goes off that way every hour if we keep moving cuz we don't want to I don't want 4:27 to be inside and sitting down for 10 straight hours that's not me you know that's not me and then what we're going to build so um let's build a full stack ml application and we're going to build I had this idea something simple because 10 hours is a lot of time but it's also not enough time if something goes wrong cuz I'm going to be doing all of this live so let's build food notf food.app so who remembers hot dog not hot dog we'll start off and again if this takes less than 10 hours we can do something else but hot dog not hot dog of course the model to build for this is pretty straight forward you get photos of hot dogs and not hot dogs but we want this deployed so I want to before the end of the stream you should be able to go to food food.app and use a machine learning model to take 5:29 a photo of something and see if it's food so what we have to do is let's go to do we need a data set we're going to do all of this from St scratch collect data set and then we're going to model data set build application um deploy application and then after that well who knows okay so we don't have any data we don't have a model we don't have an application and we can't we have haven't deployed the application yet so let's start a GitHub repo who's in for that we'll build food not food.app and then if we have more time we can of course do whatever but we need to build a full stack application today um let's go new repo we want what should we call it food not food um machine learning 6:31 powered app to decide whether a photo is food or not who wants to build this choose a license it's going to be all open source so you can copy it and whatever but we have to collect a data set get ignore and let's make it python create repo so there's the repo Mr D Burke food not food hello RJ namala oh look at all these flags thank you so much for sharing them we have UK we have America we have India we have Netherlands another America beautiful we have Poland thank you all so much we have a pirate flag beautiful if you're living if you're watching this from a pirate ship hello there's going to be some Treasures out there I am from Australia 7:31 so let's do it okay we need a data set people who's ready to start going so I'm going to also probably put the notion here um that way you can see copy link show link options people want that way people can uh see notes on notion okay everyone's ready to go now food not food see notes on notion and we also need an image um save image as hot dog not 8:35 dog Poland hello hello oh the kangaroo Egypt Pakistan France Nigeria hello hello everyone welcome welcome welcome this is going to be fun all right we're going to spend most of it coding and then if we have spare time I'll answer questions probably by the time I get cooked I'll um I'll just start talking to you for a bit and then go back to coding I actually don't know I have no idea how this is going to turn out so we'll see we're doing it to celebrate 100,000 subscribers so thank you so much wherever you are in the world for tuning in to my crazy videos this will probably be one of the craziest so let's go to CD food not food LS clear beautiful food not food okay um I'm going to now add the image into there so LS 9:36 um desktop L tell me if you can see the terminal we're going to be using this a lot clear LS we want hot dog not hot dog 9:58 move um I want code food not 10:22 food now we're going to add hot dog not hot dog so people know what we're working on first commit add hot dog image what we're going to build so let's let's do this collect data set so I want to show you how we can this is we're going to deploy it a few different ways actually um I just realized this so a lot of people ask me how do I work on my full stack application so hopefully this stream is going to show you like how I would approach it um so we can do it with gradio we can also do it with live web app um we could do it as an API I mean there's three different ways but I'm probably going to use it with tensorflow.js why is that because tensorflow JS runs in the browser and it's very easy to to once 11:26 you if you know a bit of JavaScript you can get it up and running pretty quickly so collect data set we need need images of food and not food we're going to figure that out right we don't have a data set and then we'll go model data set we want to um build a computer vision model to classify food and not food and oh I just remembered that we want I've got a tweet here this is the important thing about data sets we go here you all know Abraham loss function very very smart person this is why we have to build a data set so we want data set or no we'll go ml 12:27 model why isn't that embedding it won't embed that's all right but this very important if you had 8 hours to build a machine learning model we have 10 I'd spend the first 6 hours preparing my data set quote from Abraham loss function which is of course Abraham Lincoln but I've memed that so let's bring this in here this is what we got to pay attention to what if you it's easy to start a machine learning model with a data set but what if you don't have a data set and what we're going to build what we're going to build and we want let's get in that image of hot dog not hot dog choose image where hot dog not hot dog code okay 13:34 [Music] caption what we're building except for food not food a nice and simple app that's what we want so full stack machine learning application surprises at 77 minutes in every hour someone keep a track of an hour and thank you for this is going to be saved yes you're right uh you're good in JS is it easy to me to learn machine learning in JS yes of course it is I'm about to show you I'm terrible in JS but we're going to figure this out tweet ah thank you there we 14:20 go um delete so now let's go back to where we were I'm going to get out of that put in the GitHub what we're building except for food not food let's go image source 14:54 equals did that not push 15:18 okay we're on so now let's figure out how we can build a data set we need to model data set we need to build application simple HTML with JavaScript and then deploy model we've got a few options here gradio gradio is probably the easiest I'll show you how how beautiful that is once we've got a data set though we don't have a data set um and then there's also we're going to do tensorflow Js and then maybe an API so let's do that uh we're going to deploy a web app and Implement ml Ops dark mode please maybe I should turn on dark mode for for the stream 16:19 system dark mode boom we're on dark mode why didn't that go into dark mode 16:34 hey this is not in dark 16:44 mode 16:57 appearance how come this is not changing that's right nothing's in dark mode that's all right so let's figure out how we can collect a data set that's what we want to do so we need a way let's go image net a good downloader download imag net uh down download from imag net we need 17:39 images so we don't want the full image net data set of course who knows how to turn on dark mode in vs code why is that not dark 18:17 I just restarted 18:27 it 18:40 that's all right we can go light mode light 18:52 mode contrl P theme thank you them no 19:22 results ah here we go there we go we're on we're in the dark Ness people welcome to the darkness welcome to the darkness my friends so let's collect a data set and build a model first do I have I'm trying to think I should train the model on my deep learning PC so let's connect to that opening remote we want clone get [Music] repo food not 20:22 food and I have a tensorflow environment ready to go all 20:39 right 20:57 cond beautiful so we have hot dog not hot dog and we want we need to find a data set 21:16 though image net data downloader so that's what we're going to do now first things first is collecting a data set so when I make time stamps for this video I'm going to say timestamp and then that way I can search the text and say timestamp that collect a data set is at this Tim stamp so we're going to four images of not food download random images from imet and for images of food um we can use food 101 so we're going to combine two different data sets food 101 random subset of images from food 101 hey Egan how are you it's 1:00 a.m. in Turkey oh no worries my friend yeah 22:17 this video will be on the channel for everyone um for everyone is uh who who can't join into to the live stream no worries this video will be on my my YouTube channel once it's finished and I will put time stamps in there will be a lot of time stamps probably build a computer vision model to classify food and not food so this is what we need we need images of not food and we need images of food so let's go to here is there imag net downloader data set this is what we want imag net data sets downloader you can create data sets from subsets of imag net by specifying how many classes you need and how many images per class beautiful this is achieved by using URLs provided by imag net wonderful okay so the following command will randomly select a 100 100 of imag net classes which at least 200 this is what we want okay so we want to 23:17 build a not food data set from each selecting class so let's go imag net class list how many foods are in here Food Food Market grocery store Market okay what we could do is we could download this and then randomly select say 500 classes or something and then then delete the ones that are food cuz that way we'll have a data 24:07 set is banana in here banana I see fruit jack fruit pineapple apples okay so that's that's what we need we need some data from imag net how about we do some data processing on 24:39 this [Music] so raw let's start up a python script hello from Pakistan hello from Peru you're looking good brav thank you Adam I appreciate it my friend Asik it's 3:45 a.m. there well I appreciate you joining in Legend banana banana 25:22 banana wait why is this download Nvidia compute hey hey hey hey hey I don't want to get that why did that just download a Cuda 25:46 repo we want let's just download the zip of this download zip what's in this Z zip uh why not just download non food images from the web well think about how many different non-f food images we'd have to download whereas we can just use this imag net um so I'm going to need to copy this over so let's move this into 26:26 downloads 26:36 actually we'll move it to the desktop so we have image net a th000 class idx to label so uh yes aik I am connected to the Deep learning PC via SSH you can see that there this is running um on my deep learning PC downstairs um oh no I don't need the Nvidia SMI hello from Saudi Arabia hello from Australia there we go we have a Nvidia Titan X GPU ready to go but we have to do some data processing first so let's get to terminal we CD into desktop oh no we can just commit it so um move image net and then we want to move this to code food not 27:56 food so now we're going to just add the image net classes we'll commit 28:19 this and then we can just pull that down on we could have secure copied that SCP but we're going to just pull so now we 've got imag net classes here beautiful okay so now we need to write some python code to we want to get all of the classes in here that are not food that way we can build a data set we can download images from imet that aren't food so if someone takes a photo of not not food class it will recognize it is not food hello from Florida hello from Iraq oh well a Chic you just wait the Deep learning PC is going to be used a whole bunch we have 100 people watching thank you so much for tuning in okay so let's start to write some code and we can just probably manually go through all of these classes and delete them if they're uh if they're 29:21 food does that make sense and then we can get all of the ones that a not food and we'll download 100 images of each and that way we'll have a pretty big data set of like 10,000 images and of course this doesn't include everything in the whole world but that's the idea of our model is to learn a probabilistic relationship between what a food image of food looks like and what an image of not food looks like so let's create uh if you want to replicate this this will all be on my GitHub um and now let's open up this data exploration we want import pandas as PD uh import num 30:16 NP import CSV reinstall hold on kernel I want okay there we go um we want with open image net copy the path dot um read bit as f um f read lines we want imagnet classes equals a list and then f. read lines is this going to work might have 31:16 to look up how to read a a text file imet classes. pend M1 is going great oh did that work beautiful okay uh maybe we don't want to read it as bites so we don't have bite strings there we go okay read lines um but we don't necessarily want that we've got each one as a line or we could just go imag net classes equals f. readlines image net classes beautiful um this is a Jupiter notebook this is a Jupiter notebook running in vs 32:19 code so there's a better way to do this let's look that up um python how to read in dictionary from txt dictionary from a file file open dictionary string as literal 32:53 aval is this from the python standard Library okay we just want read f. read and 33:25 then okay beautiful we've got a a a list of imet classes now hm who knows a good way to explore a dictionary in vs code yes you do get to press Tab and get suggestions look at this um there we go vs code is very good hello from Ivory Coast I don't even know what that is let's look up Ivory Coast Ivory Coast hello from Brisbane Australia Ivory Coast wow West Africa so good to see you thank you for joining in that's amazing what does Ivory Coast look like wow that's beautiful how do you say this cot 34:27 deore diore sounds French okay we're getting a bit distracted let's go back to the code so we need a way let's go through this and how do we edit a dictionary I mean I turn a dictionary into I want to remove let's Loop through this so for imag net classes so we want 4 KV in image classes. items um if V if V do contains um banana print K string has no attribute contains python check if string 35:30 contains string I thought find does python have a string contain substring oh in I'm too used to writing pandas if banana in the 954 okay so H maybe we just go imag net Food 36:18 classes no way this guy swar k has built food not food distinguish between food and non-food see this is the beautiful thing okay how did they create a data set vgg 16 how do they get the data 36:55 set 37:05 food image data set beautiful look at this team we have so many different options okay well that link is dead look at that to develop an app that can distinguish between food and non- food we're going to extend this you know what we're going to come back to our friend uh sishwar k at the end of this and once we've built it we'll uh we'll Link in the app hey come back he built the model but didn't build the app to do come back to how do you spell his name said isua ISU to say we've built the app we're going to come back to this lovely person and say hey you know what thanks you for getting that started online we're going to we're going to we're going to build upon it so what other foods are in here 38:06 Apple pineapple is there meat in here meat egg um 38:25 chocolate see this is how you got to go through crafting a data set so let's go um python list of common eaten 38:45 Foods nope hello from Turkey it's French could pronounce it as cavor I'll probably get all this wrong hey hey from Columbia two people from Colombia thank you so much um what do you think about the new Macbook Pros will first M1 generation be about be enough for beginner medium DS and ml user yeah for sure the beginner ml I mean M1 is a fantastic machine I've got some of the new ones on order I'm going to test them out too so python here we go close 39:46 oh here we go nltk you can get what does this do 40:13 this is beautiful we're just going to combine a whole bunch of different data here so USDA food data oh we could work through this I've already got this data downloaded let's try the nltk method and then we'll come back hey we'll get this the food Cy net and word net so let's go food wordnet subset downloader congrats on 100K thank you so much uh Trey review that's what we're doing we're getting a data set of only non food food 41:15 items uh an M1 with 16 g g gig of RAM is uh perfect to get started full Fast multi-threaded download of images from 41:43 imet okay here we 41:55 go so let's install nltk hey nltk 42:24 wordnet okay let's do this seeing 8:42 a 8:43 a.m. freaked you out yeah it's nice and early here um let's let's try this out let's install nltk hey so what's the recommended installing 43:20 nltk so we need to install nltk 43:33 nice and quick and we're going to download this is a very nice 43:52 website okay so let's let's just save some steps log downloaded imag net class list from GitHub um downloaded and installed nltk want to get um nonfood classes from imet installed nltk to get um to try and get a list of words associated with food this is our log clear LS we have where's the image net classes I'm just going to put this here this is so someone can replicate what we've done I'm just going to I want the 44:53 code to be um it's all going to be open source so I want someone to be able to replicate what we've done so let's let's now go back and figure out what this 45:09 does so this is going to be we'll make it here food names from NL 2K hello Manus how are you uh vamy thought I was in California no I'm in Brisbane Australia my friend land down under so from what I understand do I not have nltk no module named nltk we're going to have to do some environment refreshing 46:09 nltk hey why didn't that install in 46:24 ltk requirement already satisfied in sight packages um H I want to cond how to install in current M with Pip it should 46:51 install yes okay this is what I want 47:02 cond install pip that's what I 47:18 need there we go okay clear now we want pip install and ltk requirement already satisfied in site packages okay pip install um cond MV list we want it in the current 47:54 EnV 48:08 wonder if I can just install it from here pip install and ltk requirement already satisfied I don't want it in there oh there we go import nltk no modle named nltk 48:38 Classic oh I had to restart the 48:54 konel machine learning insist on neural network so Neal network is just a function estimator machine learning in a nutshell is you use machine learning to identify patterns and data or turn data into numbers whatever data is could be words could be images could be videos could be text could be anything and then you use a machine learning algorithm to turn that data into numbers or a pre-processing algorithm to turn that data into some numer representation then a uh machine learning algorithm such as a neural network or whatever will go through those numerical representations and find the patterns in there what the patterns are you define and what the patterns are that the machine learning model actually figures out it learns those patterns okay so let's see oh look at this team there we go okay we've got a list of classes this is wonderful um Let's Go nltk Corpus what's wrong with this yes it 49:56 worked turn the warnings off so look at this we've got a list of foods this is wonderful how long is this list I need some I need some space to code here so wordnet dopy discarded redundant search for that's all right food list oh look at this now we've got a list of food items 1,600 food items let's have a look through these so now we've got a list of food that we can we want to filter if the image net class has any of these in it look at this Tabasco chips mashed potato cut of pork Del delicious takeaway pet chocolate bar gray mullet 51:00 gamon yogurt brat okay this is wonderful we have a list of foods now so what we're going to do is got a list of foods um now we have a list of foods now to filter the image net data set classes and remove any class that contains a food so we can download images of non food from imet we're building a data set from scratch here people that way you can replicate this whole thing from machine learning model to data set building to everything so let's let's have a little bit more of a look here in our data exploration notebook we have a food list let's just view the first 10 so we have 10 and let's check if banana in food list true there we go 52:01 this a banana is our our sanity check check for banana in food list so now we want to filter the imag net data set so imag net data set I believe doesn't have okay we need to strip let's strip the strings from here we'll lower them all so they're all lowered and we'll get rid of the hyphens and any punctuation I think there's only hyphens and underscores and the same thing we'll do with this we'll get rid of the underscores and lower so um filter non filter food items out of image net list 53:02 can I show time to time your RAM usage with activity monitor yes um this is not on my M1 this is this is on my MacBook 16 in so memory I have 64 gigs of memory on here but remember I'm streaming and doing a whole bunch of things and it's Al going to use more memory if you have it so yeah I have like Dropbox uses a lot and window server and whatever but that's all right filter Foods out of here uh thank you for the comment on the mo sioban I appreciate that so filter food items out of imag net list we want to have um four food for food item in food list um string no food item lower lower 54:07 all the text no print okay and we want lower and we want to strip Japanese Plum 54:39 hey um no what's the method what's the method to break a string on a certain thing who knows this uh if you're not really sure where to start machine learning you can go to my blog and go search for this Daniel Burke five steps to ml right there's a lot of lot of out there on machine learning or whatever this will this is pretty straightforward and split that's it thank you and otherwise look up look up the machine learning road map thank you everyone for helping me with split machine learning road map look at all this look at these ads that are above me above there above there above there above there but look my GitHub machine 55:41 learning road map number one got ads all these ads are above my post my post is machine learning road map number one on G on Google so thank you everyone let's use the split command the perfectionist am I getting the new Macbook Pro well I've got some on order I'm going to test some out split okay there we go and we want so let's [Music] remove remove punctuation and lower we [Music] want food list equals food item lower do 56:49 split for food item in food list okay and now we need to create a list of item for um food item for subl list in does this work food nope for sub list in no food for food item that's what we're got to 57:50 do a list of lists 58:04 food for food item I always get this mixed up python create a list from list of lists it's a subl list that item for subl list in t flatlist equals food item for food 58:52 list no no no no I got an idea so we got food list there hey what happened there so now let's flatten it out 59:23 flat so flat food list equals food for food list in um food list 59:53 in food for food subl list in food list in 1:00:11 for did we make it we made it okay there we go so we've got flat food list we've got a list of foods now let's do the same for our image net I'll make this all nice and clean before um it's uploaded but we got a flat food list but we only really want to see the first 10 don't we and every time we rerun these cells it's going to override variables so that sucks but that's 1:00:49 okay I really love you says I'm a Noob and I hate guys who work in machine learning oh that's unfortunate man you're in the wrong stream so we have a flat food list now let's um we want imag net classes so for KV in imag net classes um if if V Dot we need to split v. lower in flat food list print K what's this going to do uh we need 1:01:51 items hey there we go fv. 1:02:08 lower so let's go check image net classes for Foods so this is our list of imag net classes and we want print KV what does this look like hen Quail Partridge Goose snail hair sorl honeycomb pin wheel plate pretzel broccoli cauliflower Cardon mushroom B strawberry orange banana so the banana sanity check is there that's beautiful okay let's now but V is also uh multi level strings so we actually want uh print v. lower and we want split on 1:03:11 comma yes and then we want the items from a list how do we retrieve the item from a list or maybe we can do a straight up comparison will that 1:03:37 work no okay I need to go to the bathroom I'll be back um Dan reflecting on your time in ml what's the biggest highlight and lowest point so far I'll be back in a second and we'll answer that question and move net for BJJ oh that's that's an interesting one one 1:04:23 sec 1:04:53 for 1:05:15 okay welcome back uh Muhammad says I've always wondered how to make do online using ml what's the easiest path there is no such thing as the easiest path well it's like every path is easy if you choose your own so I could sit here and talk at length for how to do it but my only way is to actually just do it instead of thinking about it and talking about it out loud this is like we're literally doing machine learning online right now so that's that's how I do it is I just think of something to that I'd like to build and I build that thing um but sioban said four I really easily get overwhelmed when I try to do ml project any advice or tip just keep going till you get better um who knows I'm doing a live ml project right now I might get overwhelmed so we'll see um sioban reflecting on your time in ml what's your biggest highlight and lowest point so far uh highlight is like right now 1:06:17 look at this how cool is this we can we can make machine learning apps to 100 people around the world and and share the code make it open source what's not to love about 1:06:35 that is machine learning course by Andrew on still relevant in 2021 yes most of the courses online these days are are pretty good right so like that's the beauty of online it like filters out the ones that are and the ones that are good pretty easily so a lot of people are doing a course and they they rate it pretty highly I'm not saying anyone's coures are rated pretty highly but someone might be um you know pretty quickly whether it's good or not so that's the beauty of code as well code either works or it doesn't and if it's math it either works or it doesn't so you can pretty quickly find out if a course doesn't work if the code doesn't work so we're going to go back to coding I'll get more Q&A later but we're on a bit of a roll here so I really want to start downloading a data set cuz I don't know how long the download is going to take but for building projects just do it you're far smarter doing than you are thinking um for doing machine learning online literally just don't you're 1:07:35 overthinking it just start doing it add code to your GitHub write stuff on your blog or medium or whatever that's how you do it so we need a way to compare the strings here so what's the best way to extract items from a list in Python get items from a list list so I would like to compare if this is what I want to compare you all can help me with this this is what we're going to do this is a Community Driven project we have this string I want to compare that to the flat food list so flat food list looks like this I want to know if this item is in that's what we do so we could get the imag net uh items and then we've got 1:08:37 the I want to unpack how should we do this python unpack at list string one if and doubt coded out string one string to for uh I I will save I will save the the stream will be on my YouTube channel yes string one string to so we want we're doing some basic string manipulation here people remember Abraham loss function said if you're building a machine learning project spend the first six hours preparing the data so we want string one string two in string one so that's not going to work right so not list we need to get we want to extract those 1:09:38 strings so maybe we break this down do understand what I'm trying to do so let's write this in pseudo code thank you hatan I appreciate that I'm glad you like my shirt so look at image net classes and then we want to get value from imag net classes string and then we want to see if value appears in flat food list intersect intersect could be a good one as well oh can we see weights and biases later 1:10:39 too yeah let's do that we'll get the whole shebang we'll use weights and biases to track our experiments good idea so let's try that hey that's a good idea set I want to also strip will this work if I go get rid of spaces strip list has 1:11:19 no I need to remove the strip okay that's what we're going to do we're going to create a list of um let's go 1:11:43 print no space for space word in um V do 1:12:22 lower 1:12:31 okay there we go we got a way to do that now we can turn that into a set um let's 1:12:49 go a list comparison that's what we could do maybe we do 1:13:01 that 1:13:16 intersect let's try it up here set someone said intersect and they are amazing I'm pretty sure you're going to be right intersection nothing uh this needs to be a set 1:13:52 huh then iterate over the 1:14:04 set am I not doing this 1:14:22 right python set 1:14:33 intersection oh do I need to assign it to a 1:14:52 variable what's happening here just join not not entirely sure what you want to do do I need to turn this into a hey there we go okay my set set Co I've got the itchiest nose on earth oh Maro guys what's going on um there we go we got an intersection uh you need to turn things into list first so now what we could do is a set so let's go um print we're going to get um imag net class list equals this and we'll go set 1:15:54 enget class set someone said whoever said Thank you big shout out to whoever said us a set didn't even think about that see that's the power of pythons built-in type someone has thought about this before there we go okay we got a set now let's go we've got a flat food list and we're going to go image net class set dot intersect in flat food list well done team look at that okay let's can this printing out what do we get look at that that's what's up that's what's up okay now we need 1:16:56 um this is for Foods so image net Food classes we want to filter these out equals uh an empty dictionary and now let's create this imag net Food classes equals or we want key uh k equals V and now let's have a look at imag net food food classes there we go team we're on fish on Fish on so now we've got our image net classes that are up here this is the full list of classes and this is all the ones that are related to food clip well not really actually how many we 1:17:58 got length we have 49 classes that are from imet with but I feel like we can get rid of some of these the manual filter that's what we might have to do now so I wonder what the best way is to filter a dictionary let's have a look at 1:18:41 this we're going to use our best judgment here team to what classes shouldn't be there hen we could use hen there rough rough grass what is roughed grass oh bird well that is that food or not we need to discuss this on the stream is this a is a rough grass is that food or not or is that a bird because technically that is food but let's say this is are we we classifying this as food or not food if you took a photo of 1:19:40 that what do we 1:19:50 reckon so let's remove non food classes manual sort it's food we can eat it it's a food okay depends on the culture it's a food we're classifying as it a food so going through image net Food classes manually equals now we're going to create a list here Quail Partridge Goose snail spinny lobster crayfish hair sorl almost reaching 77 minutes can you hear me breathing too loud should I turn the mic down here it's a product of food okay it's going to be food chime Bell gong well that's not a food is it so 1:20:51 $494 Birds equals food yes you're right salmon blue Jack yes puffer puffer fish blowfish bow tie a bow tie is not a food so now we're going to have to get a little manual that's okay nltk has done very well for us so far chime belt frying pan fry pan Skillet now a frying pan on its own is not food so that's not food honeycomb hook claw H lighter 626 lighter you're right pin wheel pin wheel is not food pot flower pot no 738 refrigerator ice box well it has food but it's not actually a food plate that's an interesting one no plate is not a food Bagel PR hot 1:21:52 dogs there's hot dogs what's a Cardon who knows what a Cardon is Cardon oh is that a food sunflower family including the arch choke what the heck do I do with a Cardon edible a celery stalk okay popular ingredient in Italian dishes so it's eatable eatable edible um these are all foods Cliff Cliff drop drop off I don't know what that class is to do with but let's filter it out if in doubt filter it out these are the classes we don't want uh Promontory Headland no let's go 976 six and I think that's 1:22:53 going to be it so now you're right pigs are food but dogs are 1:23:12 not oh look at that team you know what time it is well maybe you don't because you're joining in but you know what that is that's 77 minutes we now have some surprises so let me just leave a note here of where we're up to um so that's non- food classes manual sort we have tea as well thank you yeah have the fabulous Georgia bringing me tea thank you so much um we have some surprises to give away but I'm going to leave a little note here thank you thank you we're going to leave a little note um next we've got non- food classes is remove non-f food classes manual sort from image net Food classes and then we want to download um 1:24:15 imet no then we want to filter nonfood classes from imet food classes imet classes and then download non- food classes from imet downloader all right that's what we're doing next but now we have some surprises so thank you all so much for joining in I need to go to my website oh not Affinity photo we quick that cancel um I have a blog post that I'm about to publish so if we go to Safari site let me just publish this so then you can all have the link we have a 100K subscribers live 1:25:15 live stream celebration post which is now public everyone should be able to go to this if you go to Mr www.mr dk.com 100ks Subs we have this so I'm going to link this into the chat this is my way of saying thank you to you all so um we have 100K subscribers live stream celebration you found the page of magic to celebrate 100,000 subscribers on YouTube I'm doing a 10hour coding live stream you might even be watching right now thank you so much for tuning in there are some goodies to go away so we have 50% off the first month of access to all zero to Mastery Academy there's 100 codes there the first 100 people to redeem these codes will get 50% off the first month beware for all of these if you do not cancel before the month ends you will be charge full price so there's link number one you also get the first 100 people to sign up to corsa's uh Google data analytics 1:26:17 professional certificate the month off for free is this is this the right link look at this special offer for Daniel Burke fans first month free okay if you sign up there's a 100 there's 100 passes to this the link is at www.md.com 100ks Subs we have this and then we have 52% off my book Charlie walks if you use the code um 100K so all of these links we have the first 100 for each so 100 codes here for ztm we have 100 free passes for the first month of Google's data analytics professional certificate which has been taken by 400,000 people around the world if you want to learn data analytics this is one of the best courses and you get the first month for free so you could do the whole thing for free by Google and 52% off my book so make sure you go check that out it's for the first 100 people okay once the codes are out 1:27:20 they're out so check out that page if anyone wants it you're in and I'm going to put this in the description of the stream as well that way edit and then get the free stuff slash surprises here so the Link's in the description and the link is in the chat thank you all so much for joining in if you have any problems let me know but there we go first month free corsa's Google Dat otics professional 50% off the first month of all zero to Mastery Academy courses and 52% off my book Charlie walks so go and enjoy that that's the 77 minute surprise and of course it's over an hour in so what we have to do 10 push-ups what was the rules we're going to make this fun we're getting back into code in a second but we have 10 push-ups 10 squats 10 kicks 10 punches every hour 1:28:20 who wants to join in push-ups 1:28:34 first now squats I just realized you can't really see me why 52% because if you add 5 + 2 it equals 7 nine 10 I don't know if that was 10 but we'll call it 10 now 10 kicks five each leg we need to keep moving otherwise we'll be sitting down for far too long today 10 kicks two three 4 five now 10 punches one two three four five six seven eight n 10 one for good luck okay now another hour timer oh I got my breath up that's good another hour timer go and check out those links um 50% off ztm first month free on Google 1:29:36 professional data analytics and my book is 52% off valid for the first 100 people only and because you're here live you get first pick okay back to the code we have in another hour we're going to do more moving so next we wrote ourselves some notes we're still building the data set now this is important back to Edward lost function Abraham lost function saying we haven't built any machine learning code here yet because we're building a unique project and that like the the way we need to build a model is we can't build a model without data so this is what we're working on we're still collecting a data set so here food brakes will come at some point uh if so hatan is saying asking for bank account so you'll still need uh 1:30:40 on both websites zero to Mastery and corsera you will need to enter your credit card um again read the t's and C's that I've put on here if you don't cancel your subscription by the end of the first month you will be charged for the full price for the second month that's the way these platforms work I don't manage the the payment system so keep in mind if you want the free month cancel before it re refreshes so you can have 50% off the first month or you can have the first month free you do need to enter a credit card but if you just want those first months cancel before it renews the second month so that's your warning let's get back into code um as for the book you just buy you pay the price and you you own the book like the book's yours after that I'm going to refresh this te that the lovely and beautiful Georgia bought me thank 1:31:43 you okay so we need to now we have image net classes imag net classes there we go but we want to remove we want to remove all of the non food classes so imet food classes let's now update um image net manual filtered food classes we'll create another variable here we'll turn it into a dictionary so we've got a list of keys that shouldn't be in our imet food classes so let's have a look at this image net Food classes we want just the first five so we can see what's going on there slice 1:32:45 unhashable type what's going on here oh it's a dictionary so let's turn it into a list and we're going to turn this into that first five how do you view the first five items of a dictionary that's all right we can we can work with this we'll work with this so now let's um image net Food classes and so so for KV in imet food classes do items if IFK in we have keys of non food classes manual sort I'm going to get rid of that now so we're on here team in there FK in 1:33:50 here um no IFK not in that's what we want don't want keys that are aren't food from the manual sort uh what did I miss you were taking mock test um you want a Sheik we got giveaway here so this is the giveaways www.md.com 100ks Subs there we go uh thank you Georgio dictionary is not ordered you're so right we want here image net manual filtered food classes k equal V and now we we 1:34:52 have we're going to put some mark down here remove the manually filed food classes from imet food classes some classes in imag net Food classes um weren't actually food so now we're going to manually filter them beautiful so let's have a look at what our new dictionary is wonderful and we've manually filtered the food classes now so this is the imag net Food classes length wonderful we have 39 manual filtered 1:35:55 classes te is deliciosa uh you can turn the key or values into a list and splice it so now what we have to do is we have image net classes um get list of food and nonfood classes from imet so now what we want to do is compare imag net manual food classes from we still have imag net classes this is the overall list so now we want to go hey imag net nonfood classes equals a dictionary and so for every key that's 1:36:57 not in here let's get a list of those keys um get food class Keys now this is very hacky right but that's it's it's working we can refine this later if we wanted to do Keys um and we want uh no we want a list of keys food class Keys equals that let's have a look food class Keys we'll get the first first 10 okay wonderful so now we want imet non food classes is going to be what is the length of our how many classes do we have equals this is some simple data data filtering here uh hello that's 1:38:00 not it let internet classes we have a th yeah so now we want to remove remove the ones that are non food so that and we go four KV in imet classes do items if K not in um food class Keys um image net so we got some just just basic dictionary and manipulation here non food classes could this be optimized yes it could that might be an extension for one of you watching at home k equals V now we have a we have a dictionary now of nonfood classes look at that team okay and now 1:39:02 let's get how many are there 961 that makes complete sense because we have what we have 39 food classes so we've removed those from the list so now we have a list of image net non-f Food classes that we can download to create what are we working on creating we're working on creating images of not food um and food images of food can be and uh from imet photos that are food so now we have two dictionaries one is imag net manual filtered food classes and one is image net non food classes so how about we filter the strings that are in here as well image net non food classes of course there's going to be some overlap here there's probably going to be this is not a perfect data set for sure we could probably fix that out 1:40:03 chick D I don't know what a chick D is what is a chick who knows what's in IM image net is that food that's probably food but we're just going to leave that in there for now we've done enough filtering what te is it we have this is poer tea so po tea is a Chinese tea a Chinese black tea and it's one of my favorites the Chinese really figured this out po te that's what we're having images it comes in cakes like this sometimes but this is yeah this is what I'm drinking po tea with some delicious milk and sometimes a little bit of honey in there you know well let's go back we're getting distracted from from coding here let's let's lower these strings and remove 1:41:07 any uh or do we want to lower them let's just leave that at that so now let's see how our imag net class downloader works so let's write in notion log got uh list of food classes and nonf food classes from imet now to figure out how to download nonfood and food images from imet random samples and can also create a food data 1:42:09 set food image data set from food1 random samples of images from different classes how many images of each do you think we should have I reckon 10,000 of each is a good idea um someone is asking uh oh hello greetings from Europe you have to sleep soon that's all right the stream will be on YouTube later I'm going to be here for a few hours uh Michael really love this stream keep at it you're my motivation while I'm coding as well thank you so much Michael I appreciate that I I've been thinking about this for a while actually should I I've been streaming on Twitch but should I just move it to this Channel and then just keep it all in one place and then I just have a live stream playlist where all of my streams are in one place on YouTube will that clog up the channel or is it better just to have everything like separated on Twitch and whatever so let's get rid of this get rid of this get rid of this get rid of this get rid of this get rid of 1:43:13 this data downloader okay here's what we want the following will randomly select aund of imag net classes with at least 200 images in them and start downloading ah so the class list here we need it in where I list every class that appear in imag net with the number of total URLs this CSV maybe we should have filtered out that on that but that's all right we should be able to map things okay class ID class name how many is this okay we could have filtered things off this but that's all right that's probably what we should have done we can adjust it okay this is 1:44:14 beautiful I like twitch and would prefer separated 1:44:28 yeah twitch is I think twitch is still the better way to go twitch and then upload it to the VOD I mean to the other channel so okay this is probably a better list that we can filter on let's come back this is a long list but that's all right food well food is a class in here we obviously want want to filter that out we need the ID I'll be back in a second I need to pee again uh is it enough for your course for machine learning and data science or should take you can take whatever you want follow your curiosity my machine learning and data science course do you need to take that of course not like this is this is the thing there's a lot of resources out there but it's usually best to just pick a couple and practice on those so uh if you want to do Google data analytics do that if you want to do my course do that try it out that's the beauty of like having a month free you can see if you like it if you don't cancel 1:45:49 it 1:46:20 we're going 1:46:33 down uh YouTube is a source of income but like I don't rely on it so maybe we should filter on these cuz these have the these have the keys but that's all right so 1:47:00 let's I should have really just read the docs on this but why read the docs when you can spend multiple hours just figuring stuff out words.txt too big classes in image net okay let's filter these out let's get this CSV file 1:47:37 raw can we read this straight in with pandas it's all right because we've got we've got this uh we need we need the codes I didn't realize that that we needed the codes for downloading see how this takes in a class list of different 1:48:07 codes let's read the 1:48:18 script okay so it takes in a class 1:48:29 list thank you ad I I appreciate it uh hatan if you want to do the Google data analytics course you can do it but if you've already done mine you probably don't need 1:48:47 it any tips on starting a YouTube YouTube channel I just I make the videos that I I like to watch need imag net Keys that's my only advice for starting a YouTube channel need imag net Keys turns out the download script downloads using imet class keys for 1:49:31 example so we need to map class keys to the classes that we want let's download this CSV so we want let's put it in 1:50:09 here import pandas as CSV um DF equals PD we can read CSV straight from the URL 1:50:29 straight from the raw GitHub URL that's all right now dfad okay there we go and now one of the beautiful things about vs code as well is I believe it has a viewer variables we can view the data frame look at this hey hey look at 1:51:02 that that's 1:51:10 cool food okay there we go we can filter out anything to do with food but we still have our food list from nltk which is beautiful so let's filter this out now see you try review thank you for joining in I appreciate it my friend so now let's get the DF um food list we want the flat food list once we build this data set team the model building will be the easy part so we want to now filter the panda data frame if any of the class names contains uh let's go 1:52:13 DF class name what do these look like vitamin C okay 1:52:31 planking uh so this is pd. read CSV oh my bad that was a mistake import pandas is CSV that was a mistake uh class name 1:52:56 lower okay and is there any spaces in 1:53:07 these I think we can get a pretty good 1:53:16 filter look it's not going to be perfect but it's going to it's going to it's going to 1:53:27 do food list so we want to 1:53:43 now I'll lower all the strings no actually let's go get the length of DF okay 21,000 rows let's see how many uh this filters out so um filter data frame from food classes that was a glitch I don't know why it worked but yeah Georgio is correct um I imported it earlier as PD so DF non food equals DF filter on DF class name no not contains we want to make 1:54:45 this not class name string contains string. is 1:55:18 in 1:55:48 float 1:55:58 h no 1:56:05 duplicates we've got PD as PDS here panda say PD here so it seems that there's 1:56:27 bad operator not for 1:56:38 float ah how many nans are in here you 1:56:48 reckon 1:57:01 Okay so we've got a 1:57:09 few remove 1:57:18 n 1:57:26 okay there we go we're on team fish on here so we got to remove all the ones that have food in them so is [Music] food once we build this model we are on this is going to be a beautiful model okay there we go string. lower do 1:58:12 contains let's lower all the strings DF 1:58:43 equals there we go there we go DF non food how many did we filter out with 1:59:10 that 1:59:18 2,820 so we filtered out 19 classes with just the food string so 1:59:44 string now we want to filter out there we go okay so we filtered out a bunch of foods here so this is the nonfood 2:00:08 classes so we filtered out about a th with that so that's good uh but now we also want [Music] to H we also want to 2:00:36 um let's go because this is these class names DF class names have underscores and whatnot so that's is in is a perfect match so we 2:01:07 want let's go data frame filter column by strings in list 2:01:34 yeah is in is in seems the best way to do it uh have I ever used pie torch for projects um not for a project but I'm going to start using it actually 2:01:57 I think we can work with 2:02:17 this 2:02:34 yeah here we go this is what we 2:02:47 want so we can standardize the text here how about we change 2:03:05 the fishing troll I think we've removed enough classes actually it won't be perfect but let's start to download some data 2:03:43 hey so this is 2:04:12 so now we have two data frames DF food and DF non food there we go we have a thousand different classes of food I'm pretty happy with that do food now we can remove some of these which one shouldn't be in 2:04:44 here there's probably a lot of these that could be removed but let's start to download some images and then we 2:04:58 can yeah 2:05:10 plate okay that's close enough to just being all food so now what we can do hey M how are you sioban Jeremy Howard's in Brisbane yeah I believe he lives I live Liv somewhere in Brisbane not sure where so we can remove things like ball okay so that's going to be 2:05:47 to-do CU if you take a photo of a ball that shouldn't be in there should 2:06:17 it 2:06:26 ball Ball's a big one what else have we got here pin wheel refrigerator okay let's start to remove some of these from flat food 2:07:05 list not 2:07:17 food okay we're going to spend 10 minutes removing foods from this list or non foods from this let's get another timer where is our timer at actually 21 minutes okay let's spend 10 minutes M I appreciate that 10 minutes filtering data so you've never really worked on a proper problem if you haven't filtered data manually ually have you so ball manually removing not foods from Flat food list these are imag net classes as 2:08:17 well now where did I view this 2:08:31 from there we go make sure we open 2:08:43 that not food list so we got ball squashes of food puppy puppies aren't food a puppy's food in some countries maybe not in my world alligator if they're on the borderline they can stay as food perrywinkle what is a 2:09:14 perrywinkle it's a flower look at this I search for a Periwinkle and I get ads for dresses hey how are you m uh we're filtering we're creating an app called food not food so you can see the GitHub here and that'll have the link to the notion but essentially we want to build an image classifier to take a photo of something that's food not food right now we're building a data set filtering image net for photos that are food and aren't food if things I don't know is dog food let's put dog in here I'm building this from my my perspective game right okay this is good most of these are 2:10:17 food groper Runner Yellow Tail dolphin fish Yellow Tail kroer mullet mackerel ball okay Ball's going to be 2:10:40 filtered bar what's a bar blade is blade blade could be a cut of meat but we're going to remove 2:11:03 blade crepe cross delicates in Duck game game's going Garden Garden's not a 2:11:17 food hand hand and head can be 2:11:31 removed hey prisons learning jacket not a food oh we I believe we have some food here freaking of food wow thank you so much WoW wow George has just made me some food cuz we're about 2 hours into this stream we this is this is going to be the ultimate test is I'm going to take a photo of this now and will the app if we're building food not food so let me show you what the amazing Georgia has just made we're going to filter some images in a second but let me look at this look at this deliciousness so this is our test for the app is will the app classify this as food or not food thank you Georgia you're good so we have we're going to stop for Q&A in a second while I eat this food cuz I'm not going to be coding while eating 2:12:32 food so we've got a test case now jacket joint joint junk key we want these okay we have an image now to test out why not twitch today because we're celebrating 100K subscribers that food looks delicious doesn't it I'm excited to eat it oven pen pin wheel now a plate is not food either we're going to be here for 10 hours team so we need to make sure that we're taking stock of what's going on plate not food 2:13:33 pot not food powder rack 2:13:46 refrigerator saddle 2:14:00 shank spoon isn't food spring steamer 2:14:16 stick Temple we're going to eat this food in a second tongue is tongue food tongue's food in some places truck turban wedge wedges might be potato wedges we're creating a data set orange ring cornmeal breakfast meal picnic dinner tea stew caramel sweet candy dumpling pudding pastry donut jelly marmalade bread Chala flatbread pizza toast this is good this is really good once we remove these pretzels sandwich hot dog we're going to have a pretty good data set here broccoli squash cauliflower 2:15:21 split PE soy Cardone okay this is working amazing what is his twitch channel name Mr D Burke you're right coera oh thank you so much hey Cera congrats on 100K subscribers thank you so much I appreciate that I need to take a photo of that I got started learning data science on corsera and now we're here uh by the way people if you want a special deal on corsera don't forget to go to Mr dg.com 100ks Subs read the t's and C's there so you don't get charged more than you want but we have some goodies 50% off the first month first month free of corsa's Google D analytics and 52% off my book Charlie walks but let's go back to filtering data and sioban says please let Georgia know that stream things food looks delicious the stream thinks food looks delicious Georgia Thank you thank you 2:16:22 I agree okay we're almost through this list someone finished Udacity deep learning n degree congratulations massive effort my friend okay this is beautiful team look at this we have uh these are starting to be mostly all just food we're preparing the data set the modeling code and exploration will come come soon fennel Ginger mustard tobacco egg these are all foods this is great parmesan honey molasses batter chili lasagna oatmeal you got to remember though this is this is going to be inspired by imag net data set so whever that came from cup tea well cup is not food cup that'll be a tough one to do honeycomb iceberg Mountain ocean rainbow star star rock 2:17:24 shell these two aren't food either once the timer goes off we're going to eat and we're going to do Q&A so if you have any questions you like me to answer while eating I'm not going to code while eat I don't eat while I use a computer but I will eat while I talk to you Runner what's a runner I don't know let's remove that and pilot pilot is not a food don't don't eat your Pilots if you're in if you're in an airplane don't eat your pilot you heard that here first unless you can fly a plane this is good we're nearly through this is this list is about a thousand long and oh look at that it's food time we've got too many timers going on here it's going to be food time and then it's time to move again which is beautiful so and we're going to stand back up cuz we're here for 10 hours how long we been going for about 2 just over two 2:18:26 hours we're going to get to the end of this thousand list Ash Ash is not food we're making a data set to build food not food chickpeas okay I'm pretty confident the rest of these are going to be all food have you worked on a machine learning project if you haven't manually sorted a massive data set Rings going belly oh it could be pork belly sand sand is not food done okay so that's next let's write this down so code next uh answer QA while eating so this is the test case food the beautiful Georgia has made me some food we're going to that's going to be the test image for the um the 2:19:29 application food not food then filter out non food items from data frame manually sorted and then download imag net Food and nonfood classes class images and then make data set of food and not food okay we're on we're going to take a break we're not going to code for the next however long it takes me to eat this food but look at this this is some delicious food that Georgia has just made for me so if you have any questions leave them in the chat and I'm going to be answering questions for the next 10 minutes or so while I eat this oh man can we please do these streams often yes I'm looking to stream far more uh far more in the future I'm 2:20:31 going to keep building the app that I'm working on which is called nutrify wow look at this omelette Mushroom in my my country the Tim is go backwards in Australia everything goes backwards man we barely even use words to communicate like in Australia we say like yeah n yeah is a valid reply in 2:21:12 Australia who's Georgia Georgia is my girlfriend what would you say about reinforcement learning I don't know enough about reinforcement learning I think it's very valuable Deep Mind and open AI doing a lot of cool things but I don't know enough I I'm not skilled enough in re reinforcement learning to comment and I haven't yet seen like a a real big use case there was one in the state of AI report saying that reinforcement learning was used for uh whatchamacallit was used for how do you say restocking restocking uh shelves at like a 2:22:14 supermarket hey Daniel good night first of all but you passed the tent flow certificate last week and just want to say thanks for the motivation oh man that's so cool congratulations Legend M says am I from Australia yes I live in Brisbane Australia Kevin says where can I get that shirt I should have a store and sell this shirt um let's find out the brand of this shirt hold on 2:22:57 uh the brand of the shirt was there a girlfriend reveal uh Georgia has been on the stream um a couple of times that she's bought me some tea and some food but there was no uh like GF reveal no uh the brand of the shirt is OT way hway clothing they look like they make some good stuff this look at these guys this this is Australia you can buy some brown overalls you can buy a jacket but yeah Otway is the brand of shirt okay we're got to finish this food I never eaten a rush but we do have to get back to Cod let me get the chat back up I'm just taking a short break to 2:24:04 eat can I show you my notion setup um I can but I think organizing like it should be if you're going to organize your files in something like notion you should create it yourself that way you know where to look for 2:24:34 things this is delicious Georgia thank you Dan Hi how are you we're taking a little break to eat some delicious food before we get back into the 2:24:58 stream how many calor calories do I eat per day um I would say somewhere between 2 and 1 12,000 and 3,000 I haven't measured in a couple years is though Amar making you feel hungry 2:25:32 well you should have known that when you tune in to a food not food app building stream no I'm kidding how long we got left well 7 and 1 half hours left but it doesn't really matter we'll just go to when we need to go 10 hours easy 2:26:15 money uh have I done anything with knowledge graphs before I haven't actually I don't think I have maybe I have like without knowing it but not knowledge graphs I haven't used a Knowledge Graph before but graph neural networks are starting to become a real thing so possibly I will do that then I haven't had a need for it yet I probably will once I get deeper into building nutrify hey a Sheik's eating breakfast too good on you Legend sioban says congratulations on your success so far did you believe you would be here today you know what secretly yes 2:27:17 but like you can't really predict where you're going to be so like I don't feel I really don't feel any different to how I did 3 years ago I'm just sort of now there's just the numbers are are larger does that make sense like I'm still curious and I like creating and I like learning things but it's just everything else has grown around that so I developed the habit of continually learning continually creating and then somehow the internet has worked its magic and we're here today and people are watching all over the world and I thank you a lot for that and so it's I always treat it as like a circle as like I create things to put it out there people respond to that that that motivates me to keep creating and it just goes on and on and on and on but there's never really been a hey you know what I really want to get to 100K YouTube subscribers oh you probably know that I don't I don't really care about the number that's not to say that 2:28:17 I don't care about the people who are subscribed is that the number on the page will all there always be a higher number on the page so it's now I'm at 100K it's like well why don't I get to 200 well for me that doesn't really motivate me it does for some people for me it's just like am I creating the things I would like to enjoy am I having fun every day that's that's my main criteria and I feel like if I'm having fun the people on the other end of things will be having fun so who knows 2:28:53 my only Talent is getting very curious about something and then following it for long periods of 2:29:15 time 2:29:25 hellhound started the tensorflow course on udemy a couple of months ago but had to make a pause due to school coming back next week regards from Mexico Oh all the best my friend enjoy the course it's a pretty big one we're tuning in Mexico that's amazing Ariel I just want want to ask I'm a software engineering student so all my programming knowledge and focus all these time is on data structures and algorithms in OIP how useful are they in ml well 100% that's useful so like that's what machine learning is it's basically just writing algorithms to manipulate to find patterns in different data structures look at that it's a time again it is time to dance it is time to move oh my gosh which tab is my timer on there we go okay we got to stand up again because otherwise we'll be sitting down for too long but that's what machine learning is it's like programming just with data 2:30:30 so uh have I read about deep learning Transformers yes I have I I'm going to make more materials on those in the future so stay tuned Transformers are seeming to be the one of the universal architectures however there was another paper the other day that started to say like hey is it the Transformer architecture itself providing the benefits or is it how you pre-process the data am I working as a company as a machine learning deep learning engineer so I work for myself as a machine learning engineer my main title at the moment is machine learning instructor but I'm working on a project called nutrify at the moment which is going to be my return back to being a machine learning engine ER well I'm machine learning engineer now okay food is done I'll be back I'm going to take this to the kitchen and then we 2:31:30 come back and coding all 2:31:45 right 2:32:15 for 2:32:27 okay we're coming back up now I just uh I just ate so not going to move we'll we'll do double movement next hour okay we're going back to code thank you for joining me with the food let's get this over here let's get the chat back to where we need to go chat hello from Egypt thank you uh if You' just finished the Hands-On machine learning book uh what would you suggest to read next um any of Andre bov's books so Andre burov 100 page ml book I like these books 100 page machine learning or Andre burkov um machine learning engineering those are both two good books you can read them both online for 2:33:28 free but now we are back to coding so I'm going to uh put a time stamp here timestamp uh for when I transcribe this video the timestamp will show that I'm back into coding from the break so time stamp here okay let's go we need to now remove we've got we created this manual list of not food list so if you're wondering what we're doing we are building a data set of not food and food items and as we we learned from Abraham loss function it's important when you're starting a machine learning project to spend a lot of time preparing the data set so that's why what we're doing what happened to your Apple magic pad it's still here it's still here I just like I like to use both now I found out I'm back to the mouse 2:34:29 world so we can get rid of this not food list wonderful we only want the top five so we've answered the QA while eating well done so the next eating break is going to be in about 3 hours or so so like like 1 or 130 by then we'll be halfway through the stream who reckons we can get this full app built by then our limiting factor is going to be how long it takes to download food download food images so now let's recreate our actual non-food data frame again and DF food equals not 2:35:31 in is 2:35:39 in I'm going to clean this up later but it'll work remove even more not food items does that make sense not in not food list so how many does that remove we got 941 let's just put this here 9:41 good time if you ever noticed that uh apple look on this is going to blow your mind I'm going to blow your mind for a second I used to work for apple and this is the Apple time every product on Apple's website demos with 941 let's go Apple iOS 15 every demo photo from Apple has 941 in there ready 9:41 941 941 941 you can't unsee this now 9:41 941 2:36:44 941 does this even have 941 on here on the non-apple phone yes it does 941 941 941 so fun fact about that Jack Arnold thank you so much oh I remember you from the from the beginning my friend thank you good to see you here I appreciate it Alex yes data pre-processing is very uh very hacky but that's all right we're going to we're going to make it we're all going to make it DF food remove oh my goodness um ah no we need DF food not in balling series key will be reindex to match okay so now let's have a look at DF food Dot 2:37:57 okay so we removed we removed about another 100 classes that's good enough for me so now we have DF non food and DF so let's get get list of nonfood and food class 2:38:31 Keys let's go this was this was made by going through um by my criteria equals I asked myself is this a food okay still building the data set almost 3 hours in but that's okay that's that's I wanted to make this as real as possible so DF [Music] food imag net Food class IDs equals um DF 2:39:33 [Music] food what are the column names let's cancel this get rid of that uh sin ID okay that's what we want DF food sin ID do to 2:40:01 list uh we actually could we want this as a dictionary yeah that's a better option is it class 2:40:34 name what does that look like sin [Music] ID 2:40:58 let's go this is what we can do turn it into a list and then combine them to list and then we want 2:41:44 that 2:41:52 there we go okay now this is our food can we do order 2:42:09 dick so now let's do the same but for non food 2:42:44 for there we go okay we're on so now we have we have the nonfood we finally have Split Image net 28,000 nonfood items or sorry 21,000 thereabouts and we have 862 food classes so who wants to now download some 2:43:29 data Kevin I really appreciate it brother appreciate keeping it real so yes yeah you're right Alex uh the 941 number is the iPhone was revealed at 941 so now let's we've got we've got a dictionary of classes we got to figure out now how to download them so let's open up a terminal we'll get the downloader script [Music] so have I started this we need a list um so let's go to 2:44:34 notion updated list of imag net Food and non food items to [Music] include imag net keys from hey did that have GitHub in there a notion now embeds so we want the script are we running we're not running on here anymore we can close that terminal LS um make the image net 2:45:43 downloader let's go 2:46:08 I need to give some claps to this Martins frolovs good morning ruga hello hello thank you for tuning in good to see you 2:46:27 here images per class okay so a lot of images and imag net have over a th000 images per 2:46:44 class 2:47:10 this is beautiful what a great blog post 2:47:31 80% of the flicker URLs are 2:47:43 successful yeah so it's only going to use flicker URLs that's all right let's go here the data downloader only uses flicker URLs less than Total Image net images um because image n images [Music] are downloaded with different URLs however flicker URLs are most reliable I'm very excited to watch GTC next week uh I haven't got one of the new MacBooks but probably later Yanik thank you so much for 2:48:46 joining in it's late in France it's going to be recorded yes it'll live on the channel after it's done May the force be with me thank you so much I'll see you next time 0.2 seconds per image wonderful how much space do I have on this machine okay let's see um let's go to here let's clone the 2:49:43 repo uh I actually want to move this folder 2:50:13 now 2:50:28 what's happened 2:50:41 there ah I see so we actually just want to 2:51:13 move 2:51:21 we're just cleaning up the repo 2:51:35 here 2:51:43 okay what's in the uh requirements.txt 2:52:05 here so we want what requirements do we need oh it's all written in Python 3 that's beautiful hey Noah we're working on creating an app called food not food so we want to build a full stack machine learning app um to allow you to classify whether a food a photo is of a photo of food or a photo of not food and the the notes that I'm taking are available in notion and the code let me update the code so it's going to be 2:52:51 full it's going to be uh deployed by the end of the Stream So we 2:53:04 want let's get out of some extra tabs how do we use this python downloaded. py let's just try uh what's data 2:53:37 route okay beautiful so we need to create uh a folder of images 2:54:11 now let's just download 100 random images or so in into there get rid of this shopping website 2:54:34 um python downloaded. py 2:55:37 we're going to do number of classes we'll just get five random classes five and we'll also get 10 images per 2:56:13 class here we go scraping images look at that light brown Herald escapement diameter yes look at this team wooo there we go okay so downloaded some images so ran a test command to download images from with 2:56:51 so this was 2:57:09 bash now let's have a look at these images hey 2:57:21 Oh wrong machine um I'm running this 2:57:35 remotely [Music] so there we we go look at this we've got some images now this is diameter and then the class is wonderful look at this we have images now that's from Herold what does this mean I have no idea light brown beautiful eyes okay so now we need to care get rid of all of these look this is funny for image net it's like why how is this North Carolin anyway okay so we have data downloaded greetings from Turkey hello hello hello greetings from Brisbane 2:58:37 Australia so we have some images officially have some images let's oh I didn't mean to close that but that's all right we can get that 2:58:51 back so now we want how do we get a list of see if we have here imet food class IDs in De oh goodness we need to run this all is it going to error wow it didn't error there we go okay so we need to figure out how we can pass who knows who knows how to pass a list uh to a script like this right or can we just run this in Jupiter py how to pass list to um command line 2:59:51 argument who knows how to do 3:00:12 this 3:00:20 hey you're from ad alide 3:00:42 nice 3:01:10 hey they look like they're downloading from image net 3:01:29 too okay so we can look like we can 3:01:39 do quibby hello hello so we need to pass a list we want we want this we want this as Keys we want to pass this list to our command line argument this is the keys that we want what is this let's get out of this and let's get out of this pie torch and let's get out of this we'll put that up there all right so this is what we want to do we want to pass somehow pass this giant list to this command can you have an autograph sure 3:02:42 thing we download download 500 images from each of the selected class so can you pass a list can I just run this from in here python 3:03:12 um hello from Seattle WA in the USA hey thank you for the great content and training courses it helped me transition from software engineer to data scientist wow that's amazing with a large software company congratulations my friend I really appreciate that oh and don't forget people actually I'm going to say that at the next hour is the surprises don't forget the surprises if people want some surprises go and check out this link 100K Subs giving away free months and discounts and whatnot everywhere so this should this should work I reckon let's go here we want data root is going to be um let's try this try to download images python now we want data route to 3:04:12 be test images and then we can go enter we want number of classes to be five and we want images per class to be 10 test images does not oh cuz it's it's right here there we go Del Des desus plant soil pipe Swedish meatball windfall Buckeye there we go okay so that's downloading images there now wonderful let's try test 3:05:12 list 3:05:42 for 3:05:49 okay test list 3:06:12 images 3:06:41 I don't want to modify the original file empty 3:07:12 string 3:07:23 hey yeah there we go is it really live yes I'm live here I'm right here cty how are you uh are there any content creators that I look up on YouTube doesn't have to be ml um I watched RuneScape videos cty I'm live I'm live I'm right here it's not pre-recorded my friend ask me to hold up a number on my hand and I will show you that I am 3:08:09 live is this going to work no okay so we need a way to pass in a python 3:08:31 list big fan thank you so much so let's go how to pass python list to command line 3:09:00 who knows how to do 3:09:11 this 3:09:25 my goodness the ads on this 3:09:41 website oh any creators that I look look up to on YouTube um is the stream going all right I just got like a bit of a lag 3:10:04 Spike three blue one brown of course 3:10:41 for that's what I need to do I need to 3:10:59 use where's the downloader 3:11:11 script 3:11:23 this is beautiful so we have a default type equals 3:11:39 list can you pass pass string from file to python 3:12:11 command 3:12:21 can I just pass in a list I'd like to do 3:12:41 this 3:12:50 oh 3:13:11 derp 3:13:22 d d d look at that thank you Alex I appreciate 3:13:37 it someone saying add a 3:14:11 for 3:14:20 there we go okay fish on team test images wedge boom look at that okay thank you 3:14:53 I flag should I this is hm this is what I'd like to do I'd like to export those these to a cl to a like a just a a file a text file and then can you use what's inside a text file in here does that make 3:15:34 sense python use content 3:16:11 for 3:16:39 H this is not very pythonic but we we can try it 3:16:57 so so let's create the big one that we 3:17:11 want 3:17:47 there we 3:18:11 go 3:18:30 there we go okay 3:18:41 now 3:19:11 for 3:19:41 for 3:19:58 and now let's go food 3:20:10 class 3:20:40 for there we go 3:20:55 beautiful so these are the third classes that we want to 3:21:05 download does this make sense I want to put this into a file and then with this command I want to or with this command I'd like it to uh download download the images or read it is there a way to do that if I pass in a text file here does that make sense so this is the command I'd like to do all right I'd like to do this but then I'd like to pass in this food class ID string uh do txt can you do that someone let me know if we can do 3:22:10 that 3:22:40 for otherwise we're just going to have to who's ready to start downloading some images let's just start downloading let's just scoll it to the wind and we can fix this up 3:23:05 later Daniel tutorial was uploaded on official tensorflow website right anyone can forward me that link please what do you mean the tutorial on official tflow website my tutorial or a tutorial on this how many images per class should we 3:23:39 do let's just start downlo loading some images 3:24:10 hey 3:24:21 uh one pot dish says my tutorial was uploaded to an official tensorflow website was it Victor what's going on if you find the link for that one pot dish I'd love to have a look at that let's create images make do food images oh let's make D 3:24:58 data there we go and then we'll get non food images in data as 3:25:10 well okay who's ready to download this how many images per class should we get if we have [Music] food if we have we want to download oh actually let's get non food images from imet 3:25:39 first nonfood we have 20,000 classes here so nonfood class ID list and so if we download if there's 20,000 classes we want let's get at least H 10 images cuz that's going to be if there is 10 images that is it's going to be 200,000 3:26:19 images data non food 3:26:29 images you ready to try this non food images use class list uh we need string 3:26:49 um my I don't know if my tensorflow tutorial is on tensorflow's website but it's if you just search Daniel Burke tensorflow you'll find all my tens flow stuff okay let's download this who's ready to download images in three two well I just I need to hold my fingers up correctly three 2 one let's download some images oh what did we miss argument L too long damn 3:27:37 it yeah that string is 28,000 characters long um what's the maximum 3:28:00 length Okay I got this I got an idea we're just going to download random classes and then we're going to filter it on the back end yes that's a great idea so let's just download random images data we're going to make D and then we can filter them this is genius make D data images imag net images so we're going to download random classes let's do that number of classes let's do a thousand and the number of images let's just execute this in the 3:29:05 terminal we can just all the filtering we've done we can filter it on the back end so number of images per class 100 and number of classes well let's go 3:29:31 50 so 3:29:40 python python we're going to go downloader dopy we're going to store the images in data imet 3:30:02 images oh it needs to be data image net 3:30:33 images data rout is number of classes let's get th000 or 500 500 classes should be enough oh let's go the whole hog why not 500,000 classes 3:31:21 and then images per class 100 so that's going to be 100,000 images potentially downloaded should we do more classes or more images 3:31:55 let's do 50 there we go ready 3 2 1 let's start downloading data boom okay now this is going to download it's going to take a while of course so now image net images is filling up so we can fillter this on the back end heal okay 3:32:39 beautiful this is beautiful scraping stats flick up 57% 65% success rate so we're downloading images how can I concentrate 10 hours straight who knows we're going to figure out uh I'm going to get a drink of water but we're now downloading images so we're going to filter these images on the back end oh would you look at that it is time to do some push-ups and dance around started downloading images from imet going to filter these on the back end into food images and non food 3:33:39 images command 3:33:49 used downloading uh random images from or 50 random images 50 random images from a th000 random classes then filter uh th000 random classes and images into food not 3:34:32 food beautiful so this is downloading it is now time we've got a 75% success rate from downloading images from flicker so now let's uh let's do some push-ups and what are the rules let's come back to 3:34:58 notion 10 push-ups 10 squats 10 kicks 10 punches but this time we have to do double because we missed the last hour 3:35:27 20 push-ups now we got 20 squats let's move this over here uh just a little time stamp we are downloading images now Tim stamp downloading IM images 20 3:35:51 squats 8 9 10 11 12 13 14 15 16 17 18 19 20 beautiful 10 kicks we'll do 10 kicks each leg CU we need to do 20 total 3:36:26 one eight we could do a move net classifier for if I'm doing kicks or not or punches 3:36:55 now we got 20 3:37:07 punches okay it's water time for me uh we are downloading thousands of images we could end up with close to 50,000 images here so we're collecting a data set that's almost ticked off then we have to model the data set build the application and deploy oh please thank you oh well would you look at that get the water delivered by little very thank you Georgia okay we've done surprises check out the free stuff the free SL discounted stuff don't forget uh online oh please don't tell me the 3:38:09 download script is send us offline are we back if we're back let me know in the 3:38:25 chat should we start building a model am I back I'm back I got kicked off for a bit thank you so much for uh people saying that I'm back cuz I'm back we need to set another hour 3:38:49 timer okay while this is downloading images let's start to build a model 3:39:01 Hy and we should also we need images of food as well so we should get the food 101 data set all good again thank you so much so food images are 3:39:27 downloading my shirt's coming undone it's not that kind of stream this isn't twitch not an eir okay um so now we're downloading images we should start to get food 101 images or we could start to build a confuted vision model cuz once we get the data set is the biggest part once we get the data set the models are ready to go do I have tensor flow let's start looking into this model building 3:40:26 tensor flow yes tensorflow config we have a GPU available that is what's up but we need to silence the tensor flow warnings here we go we got our Nvidia Titan RTX compute compute capability is 3:40:54 7.5 do we have gradio we don't have gradio that's 3:41:09 okay 3:41:30 how many images are we having oh this is what's up team bleeding heart Bobcat okay let's close that because that's going to use up a lot of memory um but we need a data set before this let's turn off tensorflow 3:42:02 warnings Daniel do I watch cricket yes I watch cricket I love cricket 3:42:17 turn off tensor flow 3:42:38 warnings 3:42:51 there we go turned off the tentor flow do we have TF light model 3:43:08 maker we do have TF light model maker beautiful so because we want to deploy this model we need to build ra a relatively small model um can we build the infrastructure for what we want to build and then just run the code once it gets 3:43:31 in uh we are building no we're just going to leave the images in the folder that they're in we're just going to load it off that with the TF uh load images torf flow load images we're just going to use something similar to this uh no T to flow car's image data set from directory this is what we're going to 3:44:20 use main 3:44:36 directory and then we want to look up how to convert 10 flow convert saved model to TF light model here we go okay let's look into how we convert so we're going to we got data downloading over here we'll keep that 3:45:05 running tend to flow Carras we can save it to a saved model put it into a tensorflow light converter and get it 3:45:22 out wow you can just do it like that convert the model how easy is that to convert to tensorflow light 3:45:50 okay well let's let's start building a Model A sample 3:46:05 one we need to load the datas um the datas we need to load the datas let's load the datas man uh I want to move this into here move I don't want that I want tensor flow okay so we're going to keep downloading images looks like we've got about 7,000 plus images right right now let's get rid of the warnings there we 3:46:51 go cuz our model is going to be binary classification we 3:47:07 want let's just make a classifier for aircraft or 3:47:22 Anvil uh data let's let's create a small data set how many photos of aircraft do we have aircraft Anvil clear um LS let's go 3:47:51 move copy make the uh model test images copy um imag net Images slash when I copy recursive imag net images aircraft aircraft to ramble aircraft to model test 3:48:38 images 3:49:08 for 3:49:38 for cannot 3:50:01 copy ah so the files are a little bit too deep but that's okay um do I know if there's a good method to convert P torch model to TF yeah you can use on 3:50:29 NX let's do aircraft versus 3:50:38 anvil there we go clear uh if you want to convert P torch to tensorflow or tensor flow light um look up P torch i x to TF light or something like that there you 3:51:08 go 3:51:38 this seems like a good gu that's how to convert P torch to tensor flow light so now we've got a lot lot more images let's start to build a model hey Everyone likes building models so LS [Music] data so we have images of craft and Anvil so it's like OS walk uh data import 3:52:34 OS um what is it for files no for d [Music] 3:52:47 we need to make a get ignore let's add to get ignore um image 3:53:07 folders 3:53:37 for clear so now we're going to build a 3:53:53 model now we have to explore our data files uh and this is a timestamp for model building I'm going to leave a timestamp for model building that way when I transcribe this later we will have timestamps for model building now we want to find let's go print files wonderful that's how many files that we have hey why is that not in OS Lister 3:54:50 data 3:54:59 okay okay 3:55:07 good 3:55:37 for 3:55:50 now we want 3:56:02 to is there a way to does this make test size 3:56:23 [Music] 3:56:31 [Music] that was loud let's move some random files into train and test so now we need to create train 3:56:52 test um we want aircraft what's the best way to do this 3:57:22 we want to make a director in model test images in data model test images and we're going to call this train and we're also going to make another one data data model test images test okay and now we need [Music] to make splits of images so we want aircraft and airplane in here but we want random indexes so let's go import 3:58:17 random but there's not the same amount of images in each one is there 3:58:34 so let's get a list of images we'll do this the hacky way and then we'll do this the real way aircraft images hey shba what's going on will you do data monitoring in this tutorial depends depends what data monitoring you're talking about Shar we are building a full stack machine application called food not food from scratch that means we're connecting collecting a data set and we are going to be modeling it and then deploying the model later on so aircraft images equals okay so we want to get random indexes from this and then move the rest that aren't in there how many images do we have James Scott what's going on Legend 53 53 that's all right so we can 3:59:37 go train split equals um 0.8 time length aircraft images 42 okay so we have 11 test images that's all right train 4:00:07 split 4:00:17 we want num 4:00:37 p 4:01:07 huh 4:01:37 wonderful 4:01:45 6 hours to go I feel amazing we still haven't even got into the model building stage but what we're what we're getting what we're seeing here now is that data building a data set does take the longest part so when you want to work on a custom uh a custom project you need to build a data set now here's what we want to do we want to get get random indexes of certain number from list of images so we want a list of images uh what's the random choice in python python random select k sample that's what we 4:02:49 want python random 4:03:03 seed okay let's go import random I think we don't need nump I don't think 4:03:16 um random sample from aircraft images we want 10 okay and then if we do random 4:03:34 seed beautiful 4:03:48 but then we 4:04:01 want yeah that's what we can do randomly select 4:04:32 let's get the train split up here try and 4:04:47 split random sample train split train image and then test image list equals um [Music] aircraft 4:05:44 I want to get the ones that are not 4:06:06 in 4:06:36 for set no I want the 4:06:49 difference there we 4:07:06 go and then we should have 4:07:20 length so we've got a fair few images now this is good wonderful okay so now we we want 4:07:36 um 4:07:43 def create train test list Target 4:08:06 d we're going to functionalize 4:08:36 this 4:09:02 so now we want um 4:09:34 we're still downloading images people but now we need to pre-process our data into training and test sets wonderful there we go okay we're on random sample we've got a list a beautiful list now we need a list of D that that would be much better wouldn't it 4:10:02 so Target to 4:10:19 equals 4:10:36 data 4:10:45 so then we can get that list now we need to create a function to move images so we want to move we want to copy all of the images 4:11:06 from 4:11:30 let's let's make another day hey D what's going 4:12:06 on 4:12:17 split well done okay now we can get rid of 4:12:36 these 4:13:06 for 4:13:34 print image du we want 4:14:06 for 4:14:36 for 4:15:06 for 4:15:36 for 4:16:05 beautiful okay but we actually want the full file path 4:16:35 there 4:17:04 there we go team we've got list of r images of train and test we're on a roll 4:17:35 here 4:18:05 for 4:18:35 for 4:19:05 for 4:19:16 we making training and test sets here there probably an easier way to do this but I'm hacking around having 4:19:35 fun 4:20:05 for 4:20:23 there we go we've got a way to move images into train and test so let's now do the 4:20:35 same 4:21:05 for 4:21:19 so I'm just 4:21:35 moving 4:22:05 for 4:22:24 lakman thank you for 100,000 subscribers congratulations wow I can barely talk uh congrats on 100K what are you using to identify food not food I'm going to use a efficient net model probably um um image compression web app is getting server timeout I'm not very experienced with do that is it possible to do ml work on the client side instead of server side yes it is that's what I'm going to be doing today with uh tensorflow JS so I'd look into that tensorflow JS or tentor flow light so let's now 4:23:25 copy is it copy 4:23:35 two python shu2 4:23:54 copy okay copy 4:24:05 two 4:24:35 for 4:25:03 so we got to make a Target directory 4:25:35 for 4:26:05 for 4:26:35 for okay I need another helper function 4:27:04 here 4:27:34 for 4:28:04 for 4:28:34 for 4:29:04 for 4:29:34 for 4:30:04 for 4:30:34 for 4:31:04 that 4:31:34 for 4:32:27 ah congratulations thank you so much hi Venit how are you 4:33:22 we're still downloading lots of images here 74% success rate this is 4:33:34 beautiful 4:34:04 for 4:34:34 for 4:34:52 be 4:35:04 back use the 4:35:34 right 4:35:44 okay I know what to do 4:36:04 now 4:36:34 for 4:37:04 for 4:37:34 for 4:38:03 for 4:38:17 there we 4:38:33 go 4:38:44 oh no we need the 4:38:52 reverse we need train test 4:39:03 derp 4:39:16 oh we got some more movement to do Wham says hi hi Lex what's going on tell Wham I said hi too so we need to actually I need to fix this up so we're going to do some movement in a second but I'm going to finish this code we want make Target directory no we won't don't want that so we don't care about 4:40:03 that Target dir is going to 4:40:33 be 4:41:03 for 4:41:33 for 4:42:03 for 4:42:24 so now we should have aircraft Anvil yes aircraft an yes we're on okay we've got a way to make splits do the 4:43:01 twist now let's copy all of them 4:43:18 beautiful okay now we can build a model but we need to move first we have a lot of images downloading right now look at all that isn't that beautiful nearly 1,000 classes download 4:43:41 loading okay next is uh make model data sets from train test folders and then next is build model on train test data sets and then evaluate model convert model to TF light for deployment okay we're on we've got a data set Vanette yeah I'm not doing much talking at the moment because we we got to write some code that's what this stream is about we're doing a machine learning coding stream and the way we're going to check if the app works is in a few hours we're nearly halfway this is very exciting in a few hours we're going to check if the website that we build works on a a an iPhone um or you can visit it that's how we'll know we win okay time to 4:44:42 move let's bring the desk up or actually I'll put it down we have the rules are let's make a list of hours how many hours have we done we're nearly at to five let's go here hours uh to do 2 1 2 3 4 5 6 7 8 9 10 we've done 4 hours so far we're nearly at 5 actually on my clock it says 5 how long does the stream say we've been going for let me know in the chat but we have 10 push-ups 10 squats 10 punches 10 4:45:33 kicks now we have squats one two 3 4 5 6 7 8 n 10 and 10 kicks let's bring this up five each leg move this chair so I don't belt myself 10 punches now 10 star jumps for fun we're going to put a time stamp in here a time stamp for 4:46:35 train and test sets made for a test data set time stamp and now 10 seconds of dancing 4 hours 43 so John I am making uh a website called food not food which is going to use a machine learning model to predict whether an image is of food or not of food you can seal all the code here and the notion is going to track all the notes now I'm going to get some water don't forget there is the live stream celebration if you want some good deals hello window man what's going on you can get 50% off the first month of access to all zeroa master year Academy first month free of corsa's Google data analytics professional certificate so corsera giving us 100 free months for this so thank you corsera and my book is 50% 52% off so it's 4:32 so go check that out out uh read the t's and C's cuz 4:47:35 if you don't unsubscribe you'll be charged for the second month I'm going to get a drink we're downloading about 50,000 images right now so the next thing is we want to make model we're going to build a model this is exciting okay I need to clean up some of this stuff here I'll be back in a 4:48:03 minute 4:48:33 for 4:48:53 you got much of 4:49:02 your be 4:49:32 back okay let's set another timer now we need to build a model okay so we need to load the data let's do that we're still downloading lots of images load data um have we got tent to flow did you notice that we just we spent the first 4 and 1 half hours crafting a data set that's uh that's a big note in machine learning right if you want to build a custom project you need to create a custom data set and that's what I wanted to do with this uh project is rather than just start off and build a model straight away I wanted to have nothing ready and then just start building it from scratch 4:50:34 so let's do that import T to flow as TF we're going to figure out how to load some data um I think it's train data or train folder trainer can be uh model we're building this is on a test images by the way splint this is a test model we're going to build the real model once all the images are downloading you see this little see this down here we've got our deep learning PC which is downstairs from here running very hard trying to download lots of images from uh the 4:51:27 internet hot dog not hot dog Asik we're about to start modeling good timing we've got a 10 t uh data set set up over here not the official data set because we're still downloading images um if you want to know what we're building all the codes on GitHub and we're up to modeling now we're downloading thousands of images so let's let's start building a model look how many images we have now look at all these classes how cool is that but we're going to filter those in a second so we're building a binary classification model first we're going to go load in data so train data equals TF caras utils um image data 4:52:30 set actually I think I don't have the latest version of tens slow they only changed that in one of the recent ones so we're going to go trainer we want what could be our batch size batch size 32 um does this give me a dock 4:53:02 string labels equals inferred label mode color mode class names image size we want 224 4:53:32 224 then test 4:54:01 data found a 6 files look at all that that's a bunch of jargon we want to get rid of the runtime here I mean 4:54:28 warnings we got data so we got 86 this is just a simple Model 86 um training images and 23 testing images so aircraft versus Anvil this the first model that we're going to build first model timestamp first model timestamp first model um the first model that we're going to build is Just Aircraft versus Anvil and then we can scale it up to more classes with more data we'll make sure that the model is uh running fine with a small amount of data build the first model I'm going to prefetch these data sets as well so they're nice and fast train data equals train data do prefetch and we want TF 4:55:32 data we're lucky we got a big dog GPU because this is going to be build the first model okay um we can get some model code here let's go uh base model let's build an efficient net TF cares applications. efficient net b0 where's my do string completion uh doc strings hey we'll just go to the docs if you're wondering what efficient net b0 is it's this model efficient net b z this is efficient net convolutional NE 4:56:36 Network there we go this is what we have so it's an architecture from 2019 but it's just a bunch of convolutional layers it's actually mostly purely convolutional layers so we're going to build a nice and easy one effici should net b0 to start off with we can of course scale this up as much as we want as we keep going well let's look this up then docks Tor flow efficient net b0 so we don't want to include the top because we want to put our own custom layer the top layer we're removing so that means we uh when you include the top layer these efficient net models from um tentor flow so the pre-trained ones they're pre-trained on imag net already uh so we're going to instead of it outputting a th000 classes 4:57:36 cuz that's what image net has a th000 different classes we want it to Output uh two classes and in our cases our classes are aircraft and Anvil so we're just going to change the top but we also want uh the weights are going to be from imag net that's what we want and I think everything else can be that's about it include top equals false CU then if we go it's going to download the base model see downloads this from Google thank you and then we want to go base model. trable so this right now it's trainable we want to turn trainable off that means um we don't want to do any fine tuning cuz if we download this model it's going to be hundreds of layers let's have a look at that see how many layers that 4:58:38 is so heaps of layers uh if we turn trainable to false make model untrainable it means all of these base layers are going to come with the patterns that they get downloaded from and we're not going to adjust them when we train them on our own data so that means the patterns that this model the weights that this model has learned from image net are going to remain the same uh as when we downloaded it but oh we should use weights and biases let's do that before we train a model we're going to use weights and biases um to track our experiments so make model untrainable we'll just construct the model first trainable we can set that to false um and then we want to uh build a functional model um input equals input layer TF carries layers input uh then 4:59:40 the shape is going to be 224 224 3 and then we want x equals base model pass it the input and then we want X is going to be um TF caras layers we want a global average pooling 2D uh on the export here is that how you do 5:00:14 it where's the functional API that's what we need to look at um tensorflow functional API I can't remember the syntax why not efficient net V2 oh we could do that Daniel says hi oh good name love from India hello hello can you post your GitHub link the GitHub link is here five more hours to go team we're halfway Woo is that correct so we're not including the top layers so let's have a look at this what does this mean where's the functional API has this is the syn is the syntax here correct a 5:01:13 Sheik there yeah it's correct okay I forgot the Syntax for a bit I've been writing pie torch code TF flow is a little bit different um so you still don't understand the meaning of include top okay let's go here online whiteboard look at all this ads just give me a whiteboard there we go okay so we have this is a model and it's got layers here okay this is our Baseline model and when we download it we get the whole thing right but when we set include top we only get this section so include top false we get rid of that so we can put our own top on which which means we're going to have an image here of something and I know my face is in the way hold on let me move my face over here right this is our input image okay 5:02:13 that's going to go through the model and the model's layers all of these patterns here are going to be passed to our own layer so in the case of the pre-trained model it was trained on a thousand different classes because you can see that here that's on imag net imag net is a a data set with millions of images we're actually downloading a lot of them now and it has a th000 classes in there however with our problem we only want two classes which is Anvil or aircraft so we have the Baseline model here which is all these layers poorly drawn but when we set include top to be false we remove that top layer which says 1,000 right classes and we only want to put our own layer on the top and say to so we still get all the power of the model's uh what it's learned and its different weights on different images but instead of outputting to decide is this one of a th classes we're deciding 5:03:15 is this one of two classes does that make sense so the same inputs same Bas line here but now instead of an outputting a thousand options we're outputting two options so that's what we're building at the moment and that's a very poorly drawn one but I've probably got a bit illustration on my um tensorflow GitHub aik do you know where the slides are for the um Asik do you mind linking the slides to the um can you link the tutorial where we do what's it not fine-tuning feature extraction can you link the feature extraction stuff in the chat please from the tensorflow GitHub um now we're going to do output layer output layer equals TF cares oh do we need to could we use efficient net 5:04:15 V2 let's compare them that's what we can use weights and biases for TF cares layers dense um we want two right because this is our top layer we only want two classes oh no we actually want one because we're going to use a sigmoid activation function because we're doing binary class entropy um construct model model one equals um TF car's model um input layer now this is probably going to be busted input layer output layer cuz there's probably an error here that's right I haven't even included X there build a model do we need an activation function for the output here I don't think so I can't remember now let's have a 5:05:18 look at our model model one what error did we get did we get error yeah inputs to a layer should be tensors why is that not working 5:05:40 uh inputs to a layer should be tensors oh input layer 5:05:52 oops there we go okay now let's have a look at our model um from carers TF carers do U tools import plot model hey what's Cara's utils Cara's plot 5:06:31 model pip install pie 5:06:53 dot oh we need to restart this will that matter yeah why not we're going to install weights and biases anyway okay let's start to let's start getting weights and biases ready this is uh a time stamp for getting weights and biases set up pip 5:07:21 install um restart restart restart that's all right let's install this pip install P Dot pip install uh weights and biases 5:07:45 hey did I do an uppercase K that's all 5:08:00 right oh I have to install a bunch of different things I have to install graph 5:08:22 viz I'll be shocked if this works I'm going to just YOLO install this there should be a YOLO install there we go installed graph is let's get weights and biases up and running weights and biases 5:08:53 tensorflow clear weights and biases a knit paramedic try the collab okay we're going to set up weights and biases to 5:09:20 track here we go weights and 5:09:30 biases and we want hyper parameters defaults config that's what we can 5:09:58 do yeah so they set up a config this is going to be great okay that way we can compare efficient net v0 and efficient net 5:10:28 one yeah I had to install a bunch of things for we're getting weights and biases then I need to weights and bias a 5:11:00 knit import 5:11:15 WMBB let's get a lot of code on the screen and and make a really fun face so we can get a thumbnail for this video thumbnail like should we go hack a mode like I need to find a thumbnail for this video so there we go it looks like we're doing a lot of coding here thumbnail okay so we're going to get weights and biases working so we can compare two different models but now let's make sure all of this runs can we import weights and biases yes we can okay so we want how did they do that here add a few lines to any tent tolow script so weights and biases per 5:12:23 dictionary Waits and biases tensive flow guide what's this one saying can we use a functional 5:12:54 API we still got images downloading and we still got plenty of time so this is this is where we're going load files from Drive okay I'm going to turn my screen off for a second while I log into weights and biases so just give me a moment hey move this chair so we look professional let me log into weights and 5:13:30 biases 5:14:00 for I'm just authorizing my weights and bias's 5:14:17 account signing in with GitHub hello 5:14:30 aquid 5:15:00 for 5:15:21 I'm just logging into a entering an API key here 5:16:12 okay I think I've logged in let me just make sure that that key is not 5:16:30 there going to stop this project equals 100K live stream 5:16:58 modeling oh yes team what 5:17:25 on Okay so we've now got weights and biases up here let me just bring you back on Welcome Back who was that one person who do I have any web or mobile development background no I'm only machine learning one person who disliked the video well we don't have that surely no one would dislike this video okay weights and biases where are they using next you import the weights and biases a 5:18:30 net 5:18:39 so that's what we want to do sync tensor 5:19:00 board 5:19:10 sink tensor board 5:19:30 yes we on 5:19:48 that hey this is with tensorflow one dude why you using tens oflow 5:20:00 one 5:20:17 weights and biases sync tensor 5:20:30 board 5:21:00 for 5:21:07 this is what I want tensor 5:21:26 flow is this going to automatically log if this aut automatically loads I'm 5:21:59 done let's find out together 5:22:19 hey let's build the 5:22:29 model plot model so this is what's happening now uh do we have include 5:22:43 shapes uh tend to flow car's plot 5:22:54 model uh yes I'm going to be deploying I'm going to be deploying with tensorflow light tensorflow JS show shapes that's what we want there we go so this is what happens we have our images that go into efficient net efficient net outputs a feature Vector of size 1280 so that means that our efficient net model is going to turn every image that we put in into it into a feature Vector of 1280 size so uh one big array of numbers that's 1,280 numbers long then we're going to global average pull that to condense it to a single Vector smaller Vector which is this the output of that and then we're going to condense that again into uh another output Vector of shape 5:23:55 one but I feel like we could have another layer in here that's all right we're to condense it all we'll see how the model trains first so let's compile this will be interesting will weights and biases track this if it does I'll be interested I'll be very surprised we still downloading images we are still downloading images compile model model. compile loss equals TF carers losses we want binary cross entropy because we're doing a binary function uh model one we need an output fun output activation that's what we're missing I thought we were missing something sigmo did someone miss that did someone get that activation equals sigmoid model. compile Optimizer we're going to use our faithful 5:24:56 atom TF carries optimizers do atom uh learning rate can be the default and metrix [Music] equals um loss no accuracy that's what we want what why is metrix getting angry ah now let's fit the model history 1 equals model one do fit we're going to fit on the train data how many Epoch let's do 10 let's do 25 EPO it's going to go pretty quickly but we'll use early stopping um 5:25:57 create early stopping callback now what we want to do is um make sure so early stopping means that once our model starts to get worse it's going to stop so patience equals 5 if it doesn't improve on Metric monitor I believe it is Monitor equals if it doesn't improve on the Val loss validation set oh we're not going to have a validation set are we if it doesn't improve its loss do we have a validation set yeah we do we will we'll validate on the test data um epox equal 25 validation data so our model's going to train on the training data it's going to validate so it's going to so it learns on the 5:26:57 training data and then it tests itself on the validation data or the test data that's where we created a trainer test set so um let's go test data and then we want to go callbacks equals early stopping who's ready to fit the first model will this if this I don't know if this is going to upload to weights and biases actually let's let's give this a model name name equals efficient Net v 0 V1 compile epox let's go 50 ready 3 2 1 5:28:01 fit oh we get an error what did we get wrong here oh my goodness look at this input zero is incompatible with layer efficient net expected shape what is this 223 ah who caught that of course it was me coding that wrong we're fitting okay first model time stamp first model Tim stamp first model oh Tor flows out look how fast this is going done okay our model is uh performing at 100% accuracy so that is insane model one. evaluate test data okay our model performs at 100% accuracy great we've built a first model how goes that 5:29:08 what would you do with situations where you're absolutely stuck uh with two to three things with the same deadline so I would uh do I need to use yeah log for weights and biases you're right but there's no clear statement here that tells me how to use a log 5:29:38 how do I turn off these 5:29:59 warnings 5:30:16 please don't give me so many updates T to FL look at that okay the GPU is very quick okay 95% accuracy that's pretty darn good I'm happy with that weights and 5:30:41 biases we've built a test model how good's 5:30:59 that 5:31:22 let's get tensor flow tensor board logs if you go to learn tenser flow.io it's a book 5:31:37 tens board uh aik uh when I'm stuck for different things I would um just pick one focus on 5:31:59 one create tensor flow callback I knew I had one of these so we're going to copy 5:32:22 this oh my goodness why does it do that every time 5:32:58 um 5:33:12 so now we're going to import helper functions we can delete helper functions one are we still downloading data oh the data is finished we've got food images we've got images people we can start to build a bigger model so now we're going to do that in a second we got to finish we're going to get weights and bias is logging up here still nothing 5:33:47 here call 5:33:58 back 5:34:11 dur name Target 5:34:25 dur experiments equals let's do create a 5:34:58 dictionary I think this might 5:35:18 work is that how I do it see this is why you write a book so you can come back and reference your own code thank you yes please oh it's snack time did the timer go off no 5:35:47 ready okay here we go this is how we're going to get tensor board logs okay 5:36:22 let's see if this works 5:36:45 okay how did this guy did this log into weights and 5:36:58 biases okay we a warning from weights and biases when using several event 5:37:28 logs so now let's go 5:37:58 here 5:38:28 for 5:38:44 Waits and bies you need a you need a better guide here weights and biases sync tensor board don't just tell me to right sync tensor board 5:39:05 syn tensor board equals true 5:39:28 huh 5:39:58 for tensor 5:40:28 board 5:40:48 there we go okay we're 5:40:58 on 5:41:06 okay now we can try fishion net V2 but now we need a bigger data set okay we've got more data this is exciting hey the cadina what's going on uh I am working on building a machine learning application called food not food and you can find the GitHub code there we're building a machine learning model and we're going to deploy it uh using um tensorflow and we we've downloaded a data set that's what we've spent the past 5 hours doing is downloading a data set so now we've got data imag net images we need to split our images into uh food and non food images so how about we do that and I'm sick of getting all these tensorflow 5:42:06 warnings let's go [Music] 5:42:19 logs yes now I wonder now cuz we've got tensor tensor board up and running if we load our data and build another model will this upload to tensor board cuz we've got tensor board running 5:42:46 here I W to make it I W to make it with 5:42:58 you hey we're on there we go okay look at 5:43:28 this 5:43:43 GPU 5:43:58 yes 5:44:27 for 5:44:57 for 5:45:25 will this work if we can't get it to work I'm just going 5:45:57 to 5:46:18 now is this going to be on weights and 5:46:27 biases 5:46:57 for okay I'll be back in a 5:47:27 sec 5:47:45 I actually don't know I'm not using 2.7 I actually don't know why this is not working weights and biases log tensor board logs 5:48:25 do I need to write a custom Training Loop 5:48:45 um I'm perplexed let's just get into writing I thought we were going to be able to use weights and biases pretty easily but it turns out I thought last time I used was easy as 5:49:15 pie that's what I'm missing 5:49:27 log will that work if I just 5:49:45 say hey there we go what was I missing 5:49:57 before 5:50:06 okay okay we've got some we've got some reports here now let's now do the same oh we got a timer you know what that means we got 10 push-ups 10 squats 10 kicks 10 punches we're going to start building a big model because deployment needs to happen we're going to start building the model after this one 5:50:41 sec 10 5:50:55 squats 10 kicks 5:51:04 five more 10 punches okay time to build a big model next thing we're going to do is just test while efficient net V2 is not big enough the model's already performing too good on our small data a set so let's now I think I need to call weights and biases a knit sink tensor board every time I run it but that's all right okay so now we need to merge a back kick for some variety we can get back kicks baby okay so let's um let's move the data so we need to copy 5:52:06 these paths now we need to filter we need to filter out our I'm going to sit down now hello I'm a very small version of myself and now I'm getting bigger and bigger hello I'm back okay now let's filter out image net data sets so we did data exploration before that can be canned we need to start training a big model we've got a small model our modeling code works on a binary classification problem which is what we want because we are doing food not food binary classification and now we have uh a a bajillion images let's use use them so uh timestamp we're going to filter the imag net images now timestamp we're filtering 5:53:08 the images from imet so let's now let's have a look how many images do we have total um OS walk and image files equals boom os4 do subd uh files in OS Walk we're going to go into data and then image net images we need to people we need to keep this on track all right do I not have OS we're keeping this on track now let's have a look how many image files we have a 5:54:27 thousand 5:54:35 there's all the files that we have but it's really a lot more than that so we want to 5:54:57 append 5:55:27 for 5:55:35 so let's see how many images that we have we got a list of lists where's our list code Su list I need to bring this back over 5:55:56 here hey Adam welcome to the stream uh can we Implement PCA using tensorflow GS probably I'm pretty sure I've never done it tensorflow.js is uh basically just a JavaScript version of tensorflow find um sub list there we go 5:56:53 we have 50,000 images people this is what's up let's do that let's let's build a we've got enough images to build a model let's build a model Hy so let's get the class names so image does equals uh image does. append I want to move I want to reix this data set so it's just we've got 50,000 images who's ready to build a big model uh LS clear unless we're in data we want to move data imag net images imag net images um all to data imag net 5:57:56 images 5:58:26 for 5:58:37 there we go we got a thousand different classes so now we've got image files and we are also going to get image do equals um 5:59:12 hey why in that aend 5:59:26 subdo 5:59:56 all 6:00:16 so we have image 6:00:26 doors 6:00:48 okay here's our classes and now what we need to do is we've got a big food list so food class are the names in 6:01:26 there we got a, 1,999 different 6:01:46 classes why is 6:01:56 that 6:02:11 okay now let's start filtering some data give us the mullet haircut heading to sleep Alex thank you so much thank you for joining in Legend good night my friend this is uh this is vs code Jupiter running Jupiter notebook so now we need to here's what we need to do we need to move images from uh we need data we need to make train and test folders okay 6:03:26 for 6:03:46 this is what we need we need data train images and we need 6:04:08 data test how long we got left about 4 hours beautiful that's exactly what we need okay and then this image inside here is going to be food images and non- food images so let's do that we need to bring our model building code 6:04:50 here I'm going to make a data splitting notebook 6:05:06 so we want to turn this into team we're on the up here we've got we've got data we've got model code we've got everything that we 6:05:26 need 6:05:41 and then I'm going to claim this all up after the 6:05:56 Stream 6:06:26 for 6:06:55 for 6:07:04 okay don't run this cell cuz that's already run however we need to 6:07:25 filter 6:07:43 okay we want food do food class 6:07:55 name 6:08:09 going to call this food list 6:08:25 filter 6:08:45 boom baby everybody do some dancing do some Romance okay now we need to split our images from imag net images 6:09:15 into um move food images to food images folder so let's go 6:09:33 here imag net downloaded image 6:09:50 folders so these are the images that we have downloaded 6:10:03 equals folder name do lower for folder name I'm going to lower them all lowered done 6:10:34 get list of downloaded imag net class folder 6:10:52 names move food images from 6:11:05 imet downloaded folders to data gav what's going on my friend uh grav I use uh screen flow to record my course videos and the cool zoom in are all from editing did I set another timer We we forgot to set a timer team that's all right okay so let's 6:11:55 go 6:12:05 four image folder in imag net 6:12:19 if if um image folder in foodless 6:12:55 filter 6:13:03 oh we're on here figured out how to do it D equals we're going to uh OS we're going to make a d I'm going to call it image folder exists okay equals true um then we're going to No we're going to make doors of destal os path desk uh image 6:13:55 folder 6:14:25 for 6:14:54 oh that's what I need to do as well 6:15:02 follow up tweet saying actually did this post uh always start we're going to join the image folder list h and then for image to copy in images to copy copy 6:15:55 to 6:16:14 I love writing code we get the last one we'll print this out first print 6:16:55 for 6:17:25 for 6:17:54 for 6:18:24 for 6:18:54 for hm Jesus how are you vasal thank you so much I appreciate it 6:19:19 Legend ah 6:19:54 for 6:20:24 for 6:20:51 [Music] B here we go everybody Japanese 6:21:24 cayen 6:21:34 uh I don't use yeah Amar you're totally correct lower case is an issue but now there's this 6:21:54 h rashan how are you uh I don't use a Mac for training no I use a GPU what are we doing today we're building a full stack machine learning application called food not food you can find the code on GitHub uh and the notes on notion and all the code will be up there by the end of today so we're trying to copy some images what's happening here let's step back through the 6:22:54 code 6:23:24 for ah I see what's happened it's just 6:23:52 stopping need to bring the for Loop out 6:24:24 for 6:24:54 for 6:25:06 stream stream looks like it's coming back online let me know if I'm 6:25:23 back yes thank you so much Amar you're so right thank you I'm back I'm back I'm back I'm 6:25:54 back 6:26:06 what do you reckon here 6:26:21 Amar oh did that just restart everything oh goodness I'm going to have to rerun all of this 6:26:54 code 6:27:24 for 6:27:54 e 6:28:04 there we 6:28:20 go we got it thank you Amar I appreciate 6:28:37 that uh my brother is still coding in Swift so stay tuned for 6:28:51 that but I don't know enough Swift Swift 6:29:23 for 6:29:36 why is this making a 6:29:53 new food images okay this is what I want to delete 6:30:23 so 6:30:47 thank you PTI I appreciate that Legend 6:31:23 for 6:31:42 ah I 6:31:53 see 6:32:23 for [Music] 6:32:38 thank you aash I really appreciate 6:32:53 it 6:33:23 for 6:34:23 for 6:34:53 for 6:35:23 for 6:35:34 okay we need to copy all the images to here I think we've got it 6:35:53 now why doesn't it make a new folder for 6:36:23 Japanese there we go Team food images loaded locked now let's do non food images move food images from imet to 6:37:03 now time to do the same for the non- food 6:37:23 images 6:37:53 for there we go Team non- food images filling up let's get out of that data 6:38:23 splitting 6:38:46 okay we're on uh 101 food image data set created from image Vice Versa I'm not sure I think foodo 101 wasn't created from imag net so now we're going to oh it's still 6:39:23 copying 6:39:52 now we just want to 6:40:07 extract we don't care about the classes the class name is there so let's write down some pseudo code [Music] move extract food images files and move to food 6:40:43 images do the same with test okay I'll be back um um I train models on the cloud and I also train models on uh my deep learning PC and Google 6:41:22 collab 6:41:52 you thank you 6:42:07 okay background to 6:42:16 White some people ask for dark mode at the start of the Stream So we switched a mode for the rest of the 6:42:33 stream 6:42:47 jeez what do you reckon light mode for the rest of the stream team let let me know in the chat well this is even we W wigging me out okay so now we have to move we just need to adjust this a little bit let's get all the files in the in the food images so food image file pods equals OS 6:43:41 H for D um OS walk 6:44:04 light mode or 6:44:14 no we're going off light mode there we go okay I got to used to dark mode do aen files and now let's have a look at we've literally spent 5 hours manipulating data that's all right 6:44:52 um 6:44:59 python get list of all 6:45:22 files 6:45:35 there we 6:45:52 go 6:46:13 yeah boy now how many food images do we have 2,800 so we're going to need to pack that up we're going to need bump those numbers up a bit for model building damn what are your opinions on the metaverse no idea uh I'm actually sort of not a fan I prefer the real world metaverse to me really doesn't have much appeal okay so now we want to just get the copy this let's randomly get a train and test 6:47:22 split 6:47:52 for 6:48:07 there we go train and test 6:48:22 done 6:48:52 for 6:49:22 yeah I'm not a fan of the Met verse or Facebook's version of it just put it this way do you trust Facebook I know they renamed to meta but do you trust 6:49:52 Facebook there we 6:50:06 go move to train and 6:50:22 test 6:50:51 for so we're going to take in a path of images Target 6:51:21 d 6:51:51 for 6:52:21 for 6:52:51 for 6:53:21 for 6:53:51 for 6:54:07 oh 6:54:17 man so it's going to Loop through this let's just rewrite this from scratch CU I need some different logic 6:54:51 here 6:55:21 for 6:55:37 oh I need to get rid of I only want to 6:55:51 copy 6:56:16 thank you so much when is next machine learning monthly coming out uh machine learning monthly is on hold for the time being while I make other videos cuz machine learning monthly is the videos only last like a week then they're irrelevant you know so I want to make more longer lasting stuff image file 6:56:51 name 6:57:21 ah 6:57:51 for 6:58:21 for 6:58:51 for 6:59:21 for 6:59:51 for 7:00:21 for 7:00:43 there we go team we got 7:00:51 this 7:00:59 this could really be functionalized but we're just we're just hacking along here we need to get a model 7:01:21 training 7:01:38 what are we at 7 hours this is beautiful we're about to get our first big dog model training hey 7:02:20 for hey so ham what's going on uh we're building a model we're building a full stack machine learning application called food not food what's the timer going on if you go to my GitHub repos food not food you can see it there but we need to get this model built why is it taking me so long to split this data let's functionalize 7:03:20 this 7:03:50 for 7:04:20 for 7:04:47 thank you thank you thank you okay how's it going thank you going excellent we're on a roll we're on a roll image file name oh my goodness what do we need to do here Target dles food images we're 7:05:20 on oh nice thank you thank you thank you there we go we got 7:05:50 images 7:06:20 for why didn't that 7:06:50 work 7:07:20 for 7:07:50 for 7:08:10 praise the Lord okay we're on I know I've said that a lot but we are actually on here we can just do the same [Music] for 7:08:50 for 7:09:00 there we 7:09:09 go okay now we have two classes who's ready to build a big dog model I'm going to get a drink of water I'll be back 7:09:50 oh we're back time is going 7:10:06 off let's build a big dog model eh don't forget discounts are live go and see the discounts 7:10:20 there 7:10:30 OKAY model 7:10:42 time I can do some movement I got a mouthful of food but I'm ready to build a model listen to that s pelo this stream is not sponsored by S pelo but if they would like to you know where to find 7:11:10 me I'm going to finish my food first hold 7:11:20 on 7:11:50 for we have 50,000 images ladies and gentlemen welcome to the stream 50,000 downloaded images have a got that 43,000 training images 10,000 testing images we can of course upgrade it the classes are a little bit imbalanced but that's all right it's time to build a big big big big big big big dog model who's ready okay so this this stream contains coding 30% and eating drinking 70% 5% Kung Fu which Speaking of which we got we have some push-ups and kicks and punches to do 7:12:52 10 push-ups we're at the 7 hour mark time to build a big model I don't know how long this is going to take the train but we got a big dog GPU down there and we're going to push it to the 7:13:13 Limit 10 push-ups what was the other one 10 squats three four five six seven8 9 10 get some back kicks going one two three four four over five six left foot one two three four five six okay 10 punches one two three four five six 7 8 9 10 energy is back to me and now we ready to build a model let's go big dog model we'll start with an efficient net B 7:14:14 zero um or V2 V1 and let's see how long this is going to take running and let's get a Nvidia SMI and 7:14:49 watch how do you 7:15:08 do Nidia SMI 7:15:19 watch that's it watch N1 Nvidia SMI so this is the GPU it's currently got all of its memory used let's see if we run this big dog model what's it going to do binary cross entropy early stopping and we're going to train for some AO how many Apo should we train for maybe start with five to see how long it's going to take weights and biases is not defined oh we we 7:16:10 reset we reset weights and biases who's ready to train sync tensor board go loading create tensor board callback is not defined 7:16:42 classic we're only really going to get there we go we need to let's train this model 7:17:13 team uploading data watching Nidia SMI 7:17:29 oh look how fast that's going the GPU is pumping oh my gosh already had an accuracy of 93% the Titan baby look at the Titan loading okay we we can probably train for a few EPO here turns out holy crap now this is fast this is on 50,000 images mind you the images have been already trained on hey what happened there he's waiting by is logging 7:18:28 this oh we're training here look at this we're training live there we go train step we've got Epoch 7:18:48 loss compute how's the compute G CPU where's the GPU utilization there we go that's what we want to see 80% GPU usage GPU memory allocated 80 99% team we're going good very good validation training 7:19:28 have a go with that now how do I add some panels here yes this is beautiful we got a lot of warnings being pumped out here but that's okay 95% accuracy is pretty darn good Val accuracy is 95% hey atoro what's going on hey couple burpees just for fun we'll do burpees next 60 minutes okay look at this this is beautiful we have GPU is pumping actually putting the Titan to 7:20:30 use case now okay so we're looking at about 95% accuracy that's good enough for me we do have a large class imbalance we're getting far too many warnings for my liking Elon Musk oh thank you so much for tuning in I love what you're doing with Tesla there we go training Epoch accuracy is pushing towards 7:21:19 100% Doge man the Doge man taking everyone to the Mars okay look at the Titan just humming along like no tomorrow let's get a model from this 7:21:41 hey we can save save model 7:21:58 convert model to TF 7:22:19 light 7:22:28 any resources there good morning from India hello you can start this you need to know TF to build the model the GitHub is here have we done 5 epox yet how's our model going on the test data we got a model performing at 95% accuracy that's enough for me uh but 7:23:12 we let's go length 7:23:29 so we only have 2,200 food images versus 41,000 non- food images so that's what we're going to have to fix up we're going to have to increase let's increase how many food images that we have food 101 can I get the food 101 data set in the house 7:24:07 um should we do that or focus on deployment first let's just get it working deployed version working and then we can uh build a then we can build a bigger 7:24:29 model do save um food not food model 7:24:48 v0 7:25:06 there we go now we can convert to TF light 7:25:34 food not food model 7:25:48 v0 7:26:02 saved Model D TF light 7:26:18 converter 7:26:28 do we have a tensorflow light model we have a TF light model ladies and Gentlemen let's do it let's see if we can get this deployed now so to get this model do we have a timer running yes we do okay there's the way and 7:27:02 biases let's now go to um 7:27:18 reppel let's go food not 7:27:41 food going to delete now the classes for this will be one is food two is not food I think let's check the order train data. Class 7:28:18 names 7:28:27 yeah you're so right isn't the Baseline accuracy already 95% due to imbalance um yes you're right we do need to fix 7:28:48 this we'll fix it in a 7:29:00 second Aman thank you for that and same same with you artoro uh let's go class weights we can pass the class weights where do we pass them class weights go into the fit 7:29:48 function 7:29:56 let's scale the weights can you all see 7:30:18 that 7:30:37 um 7:30:48 equals 7:31:04 I'm going to scale the class for now because they're going to be different either 7:31:15 way uh yes that's actually right one so it's going to be food non food and 7:31:48 then total samples and then we go food 7:32:18 samples 7:32:48 for 7:33:06 there we go uh weight for zero is food 7:33:31 well they're going to come in like that aren't 7:33:48 they 7:33:59 since we 7:34:08 have uro thank you hey why is this 7:34:48 for 7:35:18 for 7:35:26 shouldn't they add to 7:35:47 one 7:35:58 now what do we got we got class weights let's see how this influences the training 7:36:17 run aik welcome back good to see you my friend class weit so adjust for different numbers of classes so let's see how this adjusts do we have weights and biases tracking the history here no 7:36:47 thanks 7:37:17 for okay they're the only ones we want to look at we just want to only look at Splendid 7:37:46 dream let's upload weit and bies we're going to get a new 7:38:15 run okay we're going nice and fast here team the Titan a Sheik have a got this the Titan is training like a beast so let's see where we can go we got different Darkness six and Splendid dream we want to see which one does better does the class weight affect how our model is training let's put a note in 7:39:14 here yeah so the class weight is changing it it's not as performing as good but that's what we want wonderful okay so this model is going to be a bit more robust and the metrics uh the metrics are are more uh aligned with how the model's actually going I'll be 7:39:47 back 7:40:01 how you going with 7:40:17 it 7:40:29 okay so this is much more reflective of how our model's going I think we need some more food images 7:40:45 so we're getting about 80% accur that's all right youres how are you farz how are you what do you mean by Basics tensorflow course um the modeling is not too advanced the collecting the data we went through a fair bit to get the data because this is a custom project so uh we don't necessarily have a data set ready to go now let's start comparing the models yeah see Splendid dream was overfitting because we didn't adjust the class weight now different Darkness I think we more need more images of 7:41:47 food 7:42:02 isn't it fun just to watch models train who wants to just sit here and watch this model train for a couple of minutes no we have things to do so this is probably going to be our model it's training at a very good rate about a minute per Epoch cuz the class weight is adjusting the training time 7:42:28 yeah we're getting a lot of warnings here I'd like to turn them off permanently cuz they're distracting so we're getting about 80% accuracy which is pretty good um and it's adjusted for the class imbalance so let's let's save the model 7:43:03 and then we'll get it converted to TF 7:43:17 light will you be able to fast and stream for 10 hours I've already had some food in this stream and I've been drinking tea and whatnot but I could probably fast and stream for 10 hours yeah um let's go [Music] to let's get another terminal aless we want to upload our food uh GSU to do I have GSU to here 7:43:54 clear let's create another bucket so I'm going to upload my model to Google storage and we have done six 7 hours we've got just over 2 hours left team this is beautiful so we got 2 hours left to deploy a model Easy Money console so I'm going to create a bucket so if you haven't used Google Cloud that's okay create bucket and let let's call this food Vision food not food or actually I'm going to call I'm going to use one of my existing buckets so we don't have uh model playground food Vision model 7:44:55 playground continue I'm creating a Google storage bucket because that that way we can host our model on Google storage which will be very good um now I can upload this to food Vision model playground okay LS we're going to upload this using in Google storage so um gsutil copy food not food you're starting to see how we could script this up V1 tflight uh GS food Vision model playground so we got a 15 megabyte model uh I reckon we can get that smaller who thinks we could get that smaller we should probably do that with tentor 7:45:55 flow light model TF light model maker cuz we're using the full scale efficient net we might want to use efficient net light okay so let's get that model uh thank you Kevin I appreciate that I think we can do it um let's get a smaller model 7:46:27 building uh ashik you're pretty confused with the Google bucket so the Google bucket is literally just a hard drive on the internet so rather than uh me going hey I've got this model on my local machine and every time you go to a website like say on your phone and the website going to try and query my local machine we store it on a cloud storage provider so that because there's so many they have so many data centers around it's a lot it loads a lot faster to whatever device you're using so rather than relying on my server here or my hard disk to upload something to the internet and then you take it which you could do uh we upload it to a centralized system and then that way that centralized system is able to load the the model faster so yeah that's the main reason we do that but let's uh let's now we're going to build a smaller model in a second so we should have a model 7:47:29 here there we go food not food model says 15 megabytes which is probably too big for me under 10 megabytes is probably better but we're going to make this public uh public can read it so now you should be able to download this this model so if we go to collab and this is what I mean this is the reason it's public now so you should be able to the reason why we make it public is so that if someone visits a uh a website and say food not food.app which is what we're building they can download it like this W get so the website when you visit it food food.app is going to download the model just just like that see how quickly that downloaded that's that's the power of storing it on Google and Amazon S3 is much the same uh I think Azure call it blob storage or 7:48:30 something like that but that's generally what you want so the way this is going to work is we now have uh We've downloaded a data set we've built a model and now it's up to we're up to the deployment part so timestamp model deployment timestamp model 7:48:59 deployment uh let's go here we've collected a data set we've modeled the data set we need to build the application we're going to do both of these at the same time build and deploy we could deploy with 7:49:16 gradio uh yes you got to pay for Google storage buckets but Google storage is very cheap let's have a look at this Google storage pricing look at this Cloud Storage storage is cheap online compute is what costs you uh pricing tables look at this per gigabyte per month so what's our model is 15 mbes so it's not even standard storage our model is 15 mbes so divide that by a 100 so it's costing us 2 cents a month to store this model you will pay some transfer fees so when the the model loads but that's again pretty small so right now it's costing us less than 2 cents per month does that make sense or less than 2 cents per month cuz that is 2 cents per month 2 cents per gigabyte 7:50:18 so that's that's what you need to know about Google storage so now it's public but we also do need to change the cause setting so this is something I ran into the other day cause setting cause policy Google storage bucket so cross origin resource sharing so excuse me too many bubbles in the S pelina so if you think about this from a security perspective if we if I've just made this file public and yes you can download it but what if someone wants to use that maliciously so what cause does is um I can set my bucket cause so that if you try to load this model in your own website it won't actually work for you cuz I haven't approved it so even though it's public you can download it using W get um but you won't be able to load it in a website let me give you uh an example of that so we got to start coding an app food not food we want this 7:51:19 classes I'm going to get rid of that delete so this is some code here to download a model and run inference with tensorflow JS so this is the only stuff I'm not skilled in JavaScript so this is what I prepared earlier I'll leave links to where I I got this from but this is what's going to allow us to load tons oflow JS now if we get rid of this model let's no let's upload our other one before we upload file code food not 7:52:14 food oh that's right food not food is not local 7:52:23 LS yes we can do this actually so come back into here if we run this look what's going to happen so tensorflow JS is loaded this is all this HTML does let me just step through this line by line tensorflow so let's call this food food not food food not food hello world P this app will tell you if the image you upload is food or not right this is all it's going to do watch this Kevin says JS oh yes Kevin thank you so much well I probably will have Js questions I need to learn more about JS see I'm I'm a bit more on the ml side of things but uh less knowledge well barely 7:53:24 any knowledge about JS like it took me you don't know you don't want to know how long this took me to figure out how to write this script of uh loading a model and then just creating a simple button to upload a um an image took me a long time but that's all right and we got javascripts importing okay I'm going to step through the HTML code first cuz the way a website works is you have HTML code is going to structure things so that's going to give you like the the frame it give you the title it'll give you the text it'll give you the the button whatnot uh CSS is style so that'll give you colorful right now I've got no CSS so hence this is just text on a page but that's my style I'm just making literally the most Bare Bones app that I can and then the JavaScript is the the logic behind it so um HTML structure CSS style JavaScript is the logic behind your website so what we want to do is the HTML I'm just going 7:54:26 to build it like with some plain text then the JavaScript is going to give us the opportunity to upload an image here um yeah image uploading and then the tensorflow JS model which will sorry tensorflow.js package will allow us to load our tensorflow light model because tensorflow JS is now compatible with tensorflow light uh could we load a full scale model in here using pure tensorflow probably not you probably want to you do want to convert it to tensorflow why because tensorflow JS is going to run directly in the browser that means that our model is going to work rather than sending data to an API which could be slow it's going to work directly on whatever device you're using in the browser so it's going to work within Google Chrome it's going to work within Safari on an iPhone whatever the browser is on an Android app um yes that's all it does that's it it'll tell 7:55:29 you it'll use a computer vision machine learning model to does that make sense a Sheik let me know if you have any questions uh to classify your image uh as food or not food so basically if you want to learn we could build it through an API but for me that's not the best personal experience because people often have to wait to upload data and then it has to be computed somewhere else then it has to come back why not just do it on the device they're working with um run that 7:56:43 and this repple repple is just a website uh that allows you to write code and have it quickly refreshed in the browser we could do all this locally but I'm just doing this on repple 7:57:16 so 7:57:45 for there we go okay now this is not going to and now so if we go back through here uh the HTML we've got some upload image code uh we have a label we have an input input creates a button so now I can upload a file mushrooms there we go undefined wonderful now it's going to be undefined because I just changed class names in here food not food 7:58:25 and then we have predicted class and predicted probability and now we also have a couple of script tags here what this script tag here tells us to do is to load this is um tlow JS right so we load that from cdnjs deliver CDN is content delivery Network JS deliver is like um to me I understand it as like it's similar to pip in Python so JS deliver is going to give us an mpm package which is a node package is that correct Uh Kevin so it's like loading in um uh pandas like pip install pandas for me this is like pip install tensorflow JS but the JavaScript equivalent version of that then we do the same but for tfjs TF light so this is going to give us uh compatibility between tensorflow JS and TF light because that was a recent upgrade in tensorflow uh now TF light models work with tfjs or supposedly they do and so the reason why this model works is because we've got TF light 7:59:26 there so um we've got this here but if we wanted it to load from the website Google storage we could put in a URL there so now let's do that okay so mpm I don't know what mpm stamps for but Kevin's saying that npm hosts JavaScript scripts as well as um uh packages so not necessarily pure node so now let's try to load the model in from um I want to maybe we go to terminal I want to download it so w get do I have W get installed let's just get 8:00:29 it okay we've got the model now I want to just give you an example of what's going to happen so we downloaded the model this is just the same model that we hosted in Google storage a come on man so we've got our tensorflow light model here we've just trained that so now there the same one in Google storage if we want to copy the URL we can do that go back to the repple can that can that can that we do need to update the cross region uh origin policy so look there's the model code right but if we add the model in here let's see if this works upload file downloads oh no 8:01:29 code food not food we just want to get this working and then we can go on from there could I learn to do deep learning projects without very expensive machine yes you can you can use Google collab for free mpm is like pip yeah yarn is basically a wrapper for npm so now we have food not food model which is not going to open of course because it's a TF light model I'm not even sure what that structure is but now let's load in this we'll copy the path 8:02:27 so we want food not food model b1. TF 8:02:43 light so let's see if it loads the model model loaded look at that team who's ready who's ready to test out the model uh yeah so Canal you can definitely start just start with Google collab and uh um kaggle so we've got the model food not food can H1 tags have emojis um let's go 8:03:28 burger or burger 8:03:39 no run model loaded okay we need to find let's let's get a random what should we try um truck image of a truck let's go truck is our sanity test oh and we had the beautiful food that Georgia cooked us before so I'm going to use that as the sanity test to see if this works truck. jpeg upload image where we want desktop truck hey where'd that truck file 8:04:38 go desktop truck. jpeg we're on let's see script error oh what did we get wrong undefined converting int to float 8:05:03 32 the bottom truck this one oh apparently yeah Ford have released a new truck that's electric I heard about that so we've got a script error what happens if we can this and upload our truck image do we still have a script 8:05:38 error okay that works 8:06:15 for okay we're getting a script error for this one so there's probably something wrong here we're not getting any outputs when we change the model run what outputs do we get here 8:06:45 truck 8:06:52 I think the image will be our issue will be 8:07:12 here let's console log something here we're got to this is so this is the input output type so the error we've got here is that our model is I'm pretty sure our model is not accepting the right type of uh data 8:07:45 n32 8:08:10 so we're getting an error here undefined don't cast any 32 thank you minu hatan you slept and you come back I have just woken up to start the day and I still can't believe the goat is still riding go I'm still here hey hey 8:08:44 hey script error so we're getting something wrong here let's let's console log the image what does our image look 8:09:01 like we're doing some pre-processing code now okay float 32 8:09:23 uh you can learn you don't need to do a masters for machine learning you can learn it online yourself that's how I got started but of course like it's up to you do you learn better on your own or do you learn better in an environment so shape is two dtype is float 32 h 8:10:14 for so we're troubleshooting our model here I might if I still don't if I don't get it correct we're going to 8:10:35 download 8:10:43 okay let's look at this um tensorflow light model 8:11:11 input Objective C 8:11:44 for 8:12:14 for 8:12:24 so TF light 8:12:35 converter yes I did metan I did I did change the labels here food no 8:12:59 food I don't want to log the array image sync console log 8:13:14 image so we have a script error int 32 where is int32 coming 8:13:42 from so image is 8:13:52 32 but the model 8:14:09 requires converting end flo2 to to float 32 8:14:23 whereas if we use the other model what does that 8:14:44 say warning converting in what D type is required by this model I thought it was float float 32 let's try float 8:15:14 32 8:15:24 script 8:15:44 error what UT does tensor flow light model 8:16:11 T H so we go back to the model training 8:16:39 code TF float 32 efficient net model input type is float 8:17:03 32 so let's go back 420 we're going [Music] to 420 baby 8:17:21 the model is erroring on the prict 8:17:33 function hello from Madagascar hello uh matanu you're so right the nutrify app required un 8 that's why the image was cast to tensorflow so we 8:18:01 want maybe I train the model in the same 8:18:14 way but this is yeah this is strange CU see how the D type comes in here I'm not sure why the predict function didn't 8:18:44 work TF light 8:19:14 converter how to check input type to TF 8:19:43 l uploaded model let's upload a model here we're going to check what our input type is here food Vision food not 8:20:13 food here we go this is a cool 8:20:27 website float 8:20:43 32 oh we're on shaking basket I thank you so much you're a fantastic help remove all pre-processing steps in the error messages should say what shape the data is 8:21:13 required handstand push-up 8:21:33 time we got someone else moving in here with us shape what if we choose another file well 8:21:52 done so the model model is buckling on 8:22:13 the script error and 8:22:43 then 8:23:13 for 8:23:22 undefined so the output is what's 8:23:43 buckling okay we got to move we're going to try that in a second all right push-ups 8:24:05 time you finished well done we're going to do St jumps instead of squat this time Georgia just finished her last assessment well done Georgia but we've still got just under two hours left if this doesn't work we're going back to the tensor flow light model maker 10 punches we'll finish off maybe another five with this okay one back flip at the 10 hour mark okay all right let's get this deployed see we're running into a lot of image processing 8:25:01 errors did my internet just Buckle out oh no okay we can't log the model Jake what's going on my friend yeah the shape supposed to be uh if we have a look at the image shape it gets reshaped here so if we upload the image gets shaped into that I don't know what's going on there okay we're going back to down let me know okay I'm not sure what's going on let's 8:26:03 try to recreate the same model it's time to move on because if we want to get this deployed before the stream's over we need to try and train it it a different way there's something going on with the predict function which I don't know what but let's get rid of the truck get rid of this oh wait what was 8:26:38 that load and run a uh okay let's try 8:27:02 okay let's try to run 8:27:10 this test run TF light model and if it doesn't work we're going to go with the tensorflow light model 8:27:43 maker 8:28:10 undefined just print the output you're so right but I'm trying to 8:28:30 here let's 8:28:42 see it's bu the model is not taking the predicted image in some way shape or 8:29:12 form thank you that's okay 8:29:33 okay here we go let's try 8:29:43 this 8:30:11 wow it's working here 8:30:21 in 8:30:42 32 8:30:54 you 8:31:12 rocking 8:31:29 okay let's input details it takes shape negative one D type n32 8:31:50 in 32 let's try that did we try that 8:32:11 already uh last commit was a a while ago but I'm going to commit it all at the end converting int 32 to float 32 why why is it converting int32 to float 8:32:33 32 last commit let's commit some 8:32:42 code 8:33:12 for 8:33:38 no need to cast but still we're getting some sort of error 8:34:12 here hey matanu what do you think's going on here we're getting int32 error script error it's happening at the predict function it's breaking here console let's log 8:34:39 this model about 8:34:51 there something going on with the function here let's train another model let's get a let's get more data 8:35:02 hey it's breaking at the predict function um let's let's use tlow light model maker to train a bigger model and I'm pretty sure that that'll work so let's go get another 8:35:42 script 8:36:03 uh let's get more 8:36:12 data um we want food 8:36:21 101 so I think I have it stored in a bucket in the TF 8:36:37 course food vision all classes let's go 8:37:02 here okay we're downloading more images and in the meantime we're going to build small model 8:37:35 um need to turn these tens of flow warnings off so while we're downloading some more let's let's build a model with tent tolow uh light model 8:38:12 maker 8:38:43 now we're just going to this is some Co I prepared 8:39:12 earlier 8:39:42 oh 8:40:03 okay so let's this is this data is almost downloaded uh you could probably wrap it in a try and accept I guys I really appreciate the help by the way thank you so much I'm still 8:40:42 perplexed 8:40:55 you went 32 you 8:41:04 reckon Jake programming says convert to u32 let's see what happens hey script 8:41:28 error Alexandra what's going 8:41:41 on converting image 8:42:10 to so it broke there oh did I set the timer again yes I did Harry PR what's going on so we're downloading uh we're downloading more food images to make the model better we're going to get this to work team congrats on 100K man thank you so much 8:42:49 tensor flow please set your logging info to 8:43:06 nothing what do we got wrong here 8:43:35 oh no we've run into a Cuda error 8:43:56 we've got more images prit hello sansar how are 8:44:11 you 8:44:27 so does this still 8:44:41 work 8:45:05 this still works come on now 8:45:41 for 8:46:07 okay we're training a model now with Tor flow light model maker uh but now we're going to build a bigger data set set so we have 8:46:31 data I want to 8:46:41 unzip 8:46:49 beautiful these are all images of 8:47:04 food need to go to the bathroom be back 8:48:09 the Titan's going incredibly well so we're inflating 100,000 food images here from the food1 101 data set and we're also training another 8:48:29 model no I'm using I'm sshing into my deep learning PC which is downstairs and I'm using that to compute 8:48:59 and it's taking a little while now because we're doing too many things at once on the CPU I going to get this image ready 8:49:18 look at the beautiful food that Georgia made for me earlier this is our test image right this is a delicious food that Georgia made earlier so big shout out to Georgia thank you and we're going to put this on the desktop and we're going to call this food we need to open this up and Export 8:49:58 it food. 8:50:07 jpeg there we go this is our test I'm all selftaught yes Jake you're right my JavaScript skills are terrible but my python skills are pretty good um if you want to go to find out what I did I created my own AI master's degree so I just went through a whole bunch of online courses that that tells me that tells you a lot about me and then um start AI ml is's another one as well 8:50:48 that's how I got started we've been doing ml for about 4 years now so let's we just unraveled 100,000 images so LS let's get let's upgrade the food classes to get let's get an extra [Music] 8:51:33 um let's get an extra 20,000 data points or an extra 30,000 yeah there we go okay we're going to we're going to do this we're going to do this very we want to call this food not food model 8:52:03 V2 that takes a little while to convert we're going to let that run for a bit so we're going to go back to our other editor hey vs 8:52:35 code let's open this 8:52:50 let's go to food not food and then go add more food 8:53:03 images got more food images to load balancing the data sets so we want to we' downloaded more data from food 101 now to add more food images to the model so let let's get list of food 101 8:54:07 images how's this going still exported oh it's exported 8:54:20 team it's about to start raining here we're not leaving until this is deployed load 8:54:39 image Tor flow Cara's load 8:55:01 image oh 8:55:10 do 8:55:37 it predicted non food image more then food image that's not 8:55:55 good yeah I wrote that um the heck Elon Musk doing here uh Jake programming yeah you're so right I wrote that SJ Ral as a wizard I wrote that when I first started to learn it since then a few things have changed but when I first started to learn AI uh SJ did give me a lot of uh inspiration so we need more we need more non- food images so that's what we're going to do uh I haven't done yeah 2017 so that's when I started so 4 years ago and as you can see things change but that's the beauty of having that article documented when it's 8:56:55 documented LS okay let's 8:57:06 get wait 8:57:19 sub once again we're doing sir is it a good way to solve text to text NLP Problems by doing one hot encoding so uh no I would create an embedding so Bol ad wait I'd look up hugging face um hugging face NLP hugging face NLP course I'd do 8:58:03 that food image paths equals we need more food images people equals um 8:58:24 I finished Milestone one of TF course and want to do some small cfp projects uh should I do something from scratch or use transfer learning I'd try start from scratch first and then use transfer learning to improve it you'll probably find transfer Learning Works far better than from scratch so so for file in files 8:58:59 um 8:59:10 join there we go hey 8:59:32 test 102,000 images beautiful 9:00:10 for 9:00:40 for how to remove I haven't created we're not using image augmentation no do I have a plan to get a master's degree no uh have I created any course on hugging face no use hugging faces standard course on their website I've lost some weight hope you're I've actually gained some weight I'm about 5 kilos heavier than I was at the start of the year 9:01:40 now 9:02:10 okay there we go food image paths let's get a random 10,000 get or 30,000 images that way we've got a Balan class Set uh import random random seed 42 we need to create a bigger data set to build bigger model then we're going to man which data set am I using I'm using a custom data set one from imag net and one from well about to be from food 101 so let's 9:03:03 go 30k random random 30k 30 image paths equals random dot sample uh food image paths 9:03:32 30,000 okay we have 30,000 more images or actually let's make it 35k that way it's closer to what did we get for the difference lengths of data sets let's open up model 9:04:05 building 41,000 so let's get an extra uh 38,000 9:04:25 so now we'll have 40,000 images of each food and not food okay now we want 9:04:39 to so where did I do this I did this in data 9:04:54 splitting data 9:05:09 splitting 9:05:23 I need to clean up this code don't worry I'll clean it up after the 9:05:39 Stream there we go extra 9:06:09 images 9:06:28 copy images to file image list Target 9:06:39 d 9:07:02 okay we just we just inflated our data set 9:07:21 copy three 9:07:30 oops okay we're copying data set there we go we can now build another model 9:08:09 for 9:08:30 now we've got more testing data word 9:08:47 beautiful we've got 880,000 nearly 100,000 total images now of food and not food let's try in a model here we go okay this is taking a longer time this is 9:09:09 beautiful 9:09:23 now let's go back to here add file V2 of 9:09:39 code 9:09:58 did I say food not food model 9:10:09 V2 9:10:26 there we 9:10:39 go 9:10:58 see how this is much smaller this model the V2 model but now we're also training another one a third one so the model made with tent tolow light model maker is a lot smaller hey did that not work completed uh this is not the same project as a food Vision project on ztm course it's close but not the same 9:11:53 so see we've reduced the model size here by 5x that's pretty good um now 9:12:09 let's 9:12:36 going to upload the version two of the model and see how it goes predicting food not food who's ready to go who's ready to make a prediction let's do a time stamp time stamp for making a prediction with model V2 we've tried again with the tensorflow light model maker so this is a time stamp for version two of the model made with tensorflow light model maker let's run this loaded the model upload model we need script error 9:13:39 again there we go what did we 9:14:09 get truck here we go prediction food predicted probability 100% so I think our classes are back the front cuz let's change this we got a we got a we got a prediction here team look at this predicted class with the truck now if we add up a photo of food. jpeg food predicted probability 100% yes okay need um we need is softmax the right one to do sigmoid tensor flow JS 9:15:09 sigmoid TF 9:15:19 sigmoid how's our other model going but this is working the model is now working look at this how exciting is this we've got too much going on here sigmoid what does a sigmoid give us 9:15:58 undefined so let's go console log output values Dot 9:16:38 food 9:16:52 we got it working in the browser 9:17:08 team how's the model code going here okay this is going 9:17:38 better 9:17:50 so let's 9:18:08 go 9:18:38 for 9:18:47 Benjamin Cullen what's going on oh of course I'm not giving up my friend we need to get this model deployed we need to get everything deployed let's save version three of the model see if it works 9:19:08 better 9:20:08 for 9:20:38 for okay so the output we want the ARG Max of zero maybe 9:21:08 get 9:21:38 for 9:21:58 so we need to fix up 9:22:08 the 9:22:20 output values. ARG Max is not a 9:22:38 function 9:22:58 how do I get the ug Max what happened just before 9:23:16 TF AR Max okay let's upload image model 3 while we're here much better so chicken wings Works V3 is ready to go so let's load up upload model V3 and we're almost we're almost there people we're almost 9:24:08 there 9:24:24 TF argmax is not a 9:24:38 function 9:25:01 oh it's TF ARG Max 9:25:23 we're getting 9:25:38 closer so this is Art 9:25:49 array oh we got to move we're into the final hour but is our final model 9:26:08 here 9:26:37 for so we I need to move okay the final Final Countdown is on we have 10 push-ups for the final 9:26:59 time we're going to do 10 lunges one 2 3 4 5 6 7 8 nine 10 10 kicks one two back kick three I'm going to boot this chair across the room in a second four five left one two three four five 10 punches to finish off one two three four five six seven eight nine 10 okay let's keep Kevin you've been in here the whole time my boy Legend do let's set one more timer we're going to finish this we are 9:28:02 going to finish this this took longer than I thought ug Max okay why why can't we get the ARG Max of 9:28:21 this output values is not outputting however we get the array sync output zero let's try that 9:28:53 script error let's let's block that out console log output 9:29:37 for predict output array sync array sync output is not an 9:29:57 array matanu welcome back thank 9:30:07 you 9:30:16 okay that's all right that can stay there but the output is now I want to get the array ARG Max of 9:30:36 this how did I calculate the 9:31:37 for 9:31:50 how do you turn this onto dark 9:32:07 mode wrapp in TF AR Max yeah I've got that here output do array sync done output 9:32:37 values hey there we 9:33:07 go Halloween 9:33:22 baby there we go ARG 9:33:37 Max 9:34:07 for 9:34:16 so now let's add the final model TF 9:34:37 V3 9:34:48 not food okay there we go now we can start to adjust the code how much should we expect to earn from machine learning it really depends I have no idea so now let's get rid of this I don't want to log the output I want to 9:35:17 get output values and I want to get I need to Sig sigmoid this probably 9:35:37 actually 9:35:49 let's try this is it going to predict on food food yes woohoo there we go team we finally predicted on food okay now let's predict the let's get the probability Hy no this should be um output values should be if we go to let's do TF soft Max output array sync and then we're going to go this equals argmax do eras sync and thank you Matan Shu I appreciate it my 9:36:50 Legend and then we want output values Max let's run choose file let's try truck oh it failed out 9:37:21 again oh here we 9:37:30 go run not food 100% wo there we go time stamp time stamp 100 now we're got to try it on one more image and that's the food predicted class food 100% W baby there we go team okay now let's get this onto um GitHub so we got one final step we need to host it we need to host it how long do we have left 9:42 okay can we get this hosted so let's get the cause policy set for our bucket so the cause policy allows us to download different things LS uh do we have cause. 9:38:34 Json h 9:38:58 let's go 9:39:06 here 9:39:37 I need to figure out where twitch ml deploy is all my codes everywhere twitch ml deploy there we go co. Json I don't want to open 9:40:06 xcode now let's go 9:40:36 code so we're going to make this available everywhere for an 9:40:48 hour we got it 9:40:57 loaded Pro tip unrelated use text content for inner text for performance thank you Kevin so if I just go text content 9:41:36 here Boom baby yeah yeah console log output values 9:42:06 Dot 9:42:26 okay we still need to deploy the model so we need to update the cause settings of this bucket uh GSU tool set call so the CES allows us to download um the model into different platforms otherwise if if we don't I'll show you what it's like without the cause um Google storage set cuse 9:43:13 uh set CES Json file name bucket name so this is without setting the CES let me show you what happens if we have the model as a URL so we have the model here we've got the URL if we go into our code let's get rid of some things so so we want here if we load our model with instead of see how we we loaded it with a string uh because our model is available in the file format here we want to load it with a Google storage URL let's see what happens when we try to load it using a URL 9:44:22 we run we try to load the model it won't it'll fail to fetch see what I mean so that's what happens when we try to load the model from Google storage but of course we won't always have this available so that's why we have to set the cause now if we set the cause Watch What Happens um cause config Json GS we want to set it on this bucket so food Vision model playground gsutil set CES CES set 9:45:19 now if you go GSU cuse get and then GS the bucket it should have we can now do an hour worth of these requests uh from any origin with any response header so let's have a look at what this does now notice how just before we had this type error failed to fetch now this should work if we load it from here run might take a little bit to to kick 9:45:59 in still failed the fetch 9:46:32 I thought this was going to work and it didn't work see how we've loaded tensorflow uh JS but we haven't loaded the 9:47:06 model 9:47:17 wait classic I thought this was going to work but now it doesn't that's all 9:47:30 right we're going on Twitch ml deploy 9:47:56 make sure we've got the same setup 9:48:06 here 9:48:16 type 9:48:32 error but if I change this 9:48:52 to this it gets it let's try with a different photo hey 9:49:20 Apple predicted class not food what is it just fluking 9:49:35 now oh my gosh my brain is so fried right now food predicted class 9:49:54 food okay well it worked on that but now it's not uploading to 9:50:20 now I wonder if I get this model does it work no it won't test 9:50:48 do we get the same error twitch mloy last 10 mens that's all right we're going to fix we're going to fix this we're going to get this 9:51:05 done 9:51:25 so if I put that in there it doesn't load either 9:51:54 24hour stream I'll be 9:52:05 back 9:52:35 h for some reason it's not loading but that's all right we'll fix it up GS 9:53:05 till 9:53:35 why I cut my facial hair I felt like it we're approaching the 10hour mark and I'm not leaving until this is fixed I had this working I had something very similar working why did this fail to 9:54:03 fetch I look like a boomer with a mustache I look like a boomer with a mustache uh JS uh JS deliver TF I need this I don't think this will change anything but let's see if it changes anything 9:54:47 [Music] 9:55:05 um 9:55:18 I've got the latest version here why is the cause not working why is it all of a sudden have an issue when let's try and get it on Vel and see what happens 9:55:51 download a zip I will get this 9:56:05 working 9:56:13 well let's just go to local actually local and we'll 9:56:35 go 9:57:05 for 9:57:13 we'll copy the Java Script into 9:57:35 here 9:57:46 uh but I actually want this form of 9:58:05 Js 9:58:14 we're just copying some stuff from some code I've already written but we're going to get this 9:58:35 live 9:58:54 we're going a little bit past 10 9:59:05 hours now let's deploy and see what happens oh wait we need to add the 9:59:20 model this is the beauty of tend to flow light the model's so 9:59:34 small add the US file JS file I didn't add the JS file you 9:59:59 sure oh you're right 10:00:23 let's go to our trusty 10:00:33 Vel look how easy this is to deploy now team v.com I don't want to create a team I have my git repo there it's going to 10:00:57 deploy here we go we should be deployed woohoo let's open it up up food not food model loaded food y food oh it only took us the entire stream to build but it is live time stamp time stamp time stamp the deployment there we go food not food. Vel doapp is live people okay now let's change the code a little to I'm going to make it uh Ls cuse I'm going to change this to this URL now this should be able to 10:02:00 access we are live people fully deployed check it out get uh gsutil cause set um cause config GS we want our bucket to be clear and now let's change the script here to use the model from the URL and see what happens get add script.js get update script to use uh oh get 10:03:02 commit update script to use tfjs uh TF light model from bucket get push let's see if this does anything now we're going to do the real test I need to get uh let's do camera we got a camera that's not food and I'll get some actual food and we'll see if we can compare tried it with a BK burger and it worked yes and beautiful so so let me uh see if it works still I've just updated the 10:03:47 bucket is the model going to load from the bucket I think we might have an issue here it's not loading from the 10:04:04 bucket a waiting tfjs model okay so that's broken I need to fix that but that's all right let's get this out it's deployed if I if I don't deploy it from there it's going to go get add script.js get commit revert back to using local model get 10:04:46 push oh I didn't save that I need to add up the index HTML title is food not food app get add index HTML update HTML title and uh model usage I've just changed the title I'm going to go get a um I'm going to go get food be 10:05:34 back 10:05:45 so we have two options here we have some bananas and blueberries as you can see I'm going to take a photo of these the title of the web page should be updated now and then I have then I also have a camera I'm going to take a photo of 10:06:16 that so now let me just get those over to 10:06:32 here offloading it downloads date modified so here's my camera photo I'm going to export that camera. jpeg into food not food and then here's my bananas and blueberries bananas and blueberries done done how's the app going we still working um where is it food not food model is 10:07:33 loaded there you go there's his app so we're got to choose a file food not food we have camera not food Y and then we have bananas and blueberries not food oh no why is that not working let's try it again um let's try another image of food that I know that's food 10 Whole Foods train banana bananas not food oh my 10:08:33 goodness not food okay so we need some actual food classes in the model food uh so the model is not very good that's all right let's try another class egg not food okay so I think it's getting the images we need more food images that's that's going to be the fix for this but uh that's enough for the stream let's go uh here I'm going to do one more thing oh hello bananas it's making me very hungry hey look at that mustache happy movember everyone I need to do one thing behind 10:09:34 the scenes uh to really finish this app off if you got any chat if you want to have any questions we've nearly we've nearly reached the end of it yeah we've over fit I got to fix that but that's all right we've got a simple model deployed hey arunava how are you so I'm doing one thing that's going to just finish 10:10:20 up hot dog worked I need 10:10:33 to 10:10:53 add some csss to it you can 77 minutes if you want the 77 minutes stuff you can see here 10:11:23 um I need 10:11:33 advanced 10:11:43 I'm just updating something give me one 10:11:54 second I can't do this with my stuff on the 10:12:03 screen 10:12:18 I do R Jiu-Jitsu I love Jiu-Jitsu someone says my uh explanation is very crazy for my tensorflow course is that what you 10:12:47 mean an ml engineer can be called a developer in my opinion I doing a lot of I'm doing a lot of developing 10:13:03 now thank you Ryan NG I appreciate it being subscribed thank you so much my beautiful picture of cheese 10:13:33 worked wel computer's loing lagging tell me if I'm still live YouTube don't kick me off it's right at the 10:13:51 end oh my goodness right when we want to start loading stuff 10:14:25 thank you thank you I'm still live so the app is deployed and I believe it should also be so I'm back here we go I've just started the website food food.app site can't be 10:15:02 loaded I think it's taken a little while to propagate but if you go to Food food.app it's live 10:15:21 here is this going to work on this it's food yeah baby food yeah all right it's working okay okay we're good food not 10:15:52 food um let's try another one food yes we are live it's working for me everyone the app's working for you and then if we go to a new tab if we go to food not food.app what happens 10:16:33 here is it working on Safari food not food.app yo selem what's going on I'm not sure why food not food.app is not working let me go off stream for one second I'd like to finish the stream with this being live might take about half an hour to beef sample is strong a 10:17:33 record 10:18:03 for 10:18:32 host why is this not working 10:19:03 for maybe it takes a little while to propagate through it's 10:19:24 working model loaded there we go beef is this food food yeah yeah yeah yeah food okay team I think that's uh it works for 10:20:02 you food not food.app 10:20:12 food food.app is working for you 10:20:24 guys can anyone confirm if food not food.app is working 10:20:40 well that's so strange thank you Kevin for tuning in I really appreciate it let's go to food not food not food.app 10:20:59 Kevin thank you so much so this if you guys go to this website food not food.app it's 10:21:26 working okay I got to load this this is the final test 10:21:45 it's [Music] working food food.app is not working but Vel is working can we confirm can we confirm is this link working that link is working and food notf food.app is that working is this link 10:22:30 working someone confirming me if we confirm that food not food is working in the chat then we're done food notot food.app that is crazy it's not working for me on either 10:22:56 device that is insane okay well friends thank you so much for tuning in to the 10hour stream this was to celebrate I for some reason look it's supposed to be working there but it's not that's amazing we're all good I'm even trying to load it with mobile data on my iPhone and it's not working let's try one more time we're trying Google Chrome on my iPhone with mobile data 10:23:41 Paul is trying yes food notf food.app lives everyone go to food notf food.app and you will you will test to see if your food if your photos are of food or not all right that's all it does food not food okay I now have a totally new browser on my phone food not food.app 10:24:18 I cannot believe this I'm going to try a different device maybe the propagation to Australia is not working I love how everyone in the chat everyone in the chat is leave an issue on GitHub if it doesn't work for whatever food you're using food notf food.app 10:25:04 it loaded yes I've got food. food. app food not food baby there we go okay it's working on my iPad is it going to work on my iPhone now cuz these are using cellular by the way so food not food this is what the 10 hours has been leading to food notf food. app can confirm it's not working working on an iPhone it's working on it's working on it's working okay here we go let's test it on these bananas I think it doesn't like bananas use Photo food yes you can't see that okay I need to uh screenshot 10:26:04 that and then one more one more one more and then I'll I'll I'll show you then then we're then we're done so this is a camera use Photo not food I'm going to screenshot that and then I'll just show you them on the screen because I don't know how to get this stuff on here you know share my iPhone screen let's go to there food food.app this is the this is the real life test and all of you are using it I'm so Banana is a must so yeah please let me know uh if leave a GitHub issue if there's any foods you want and we'll we'll make food not food work better but we got we got it working food vision is live people food notf food.app go and check out food not food food.app we need to upload update the website 10:27:09 with food not food.app 10:27:22 oh it is live it literally all it does is tell you the food not food leave an issue if you want it fixed or if you want more Foods added and we will work on that right we're changing the world one food and one not food at a time there we go we have confirmation to finish the stream off uh please feel free if if you want to um look at this food not food.app go and visit the website go and go and break it um this is amazing thank you so much for tuning into the stream we went we went all from from the we went from building a data set to modeling the data set we built a data set from scratch we built the application we deployed the application with a live web app we could do gradio we could do an API if you want to add some styles to the website you could leave a pull request uh please please do if if anyone adds any styles 10:28:23 to the GitHub uh in a poll request I will um I will push those changes and you will be part of the food not food Revolution okay so if you you want to style it please style it if you want to add some better JavaScript cuz my JavaScript skills are poor please do make a pull request and I will add it but that is the 10hour live stream look at that we finished it off wow okay I need to go and chill out for a bit cuz I've been staring at a screen for 10 straight hours but thank you so much there will be plenty more the video is going to live on um live on YouTube forever but if you want to see future streams I stream on Twitch as well and um you can also see streams on my archive Channel but thank you so much to the 100,000 people subscrib to this channel I really appreciate it there is plenty more to come so yeah if you want to add any code to the GitHub go for it 10:29:24 otherwise I'm out people have a good night have a good day wherever you are in the world and uh I'll see you next time B backflip and chill all right back flip to finish no I'm kidding see you guys thank you for joining in