How to train test and deploy Tensorlfow model on google colab using streamlit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my fellow scholars i hope you are doing pretty well in today's video we are going to learn about end-to-end deployment i am going to create a tensorflow model get a very good accuracy is more than 90 percent for couple of animal images and then we will try to deploy it to a website where a person can go ahead and upload his our own images and see the prediction of the backend model and everything is going to happen real time so as you can see on the screen this is a kind of ui that has been created out from the streamlit app and we will go to this browse file and let's upload one of the image so i'm going to upload a dog image over here first of all it is going to read up that image and show that image on the screen right now you can see it and let's click on generate prediction and once you will click on the generate prediction it is going to call that model on the background and that model will read out this image and generate the label for that image as over here it is saying that predictor label for the image is dog and this model is trained for not only for four and five up to ten animals images and we have used around 20 000 images to train up this model and this is a quite good model you can see let me download couple of images from internet and show you how the model is performing so i have already downloaded couple of images with different resolution and let me download couple more so here we are let me download this spider image so here i am downloading the spider image it's done let me take this this is actually let me take this one and let me take little bit complex one also so like this one and see how the model works out and i'm pretty much not sure that our model will be able to recognize it but let's take this one also so download it now let's go to streamlit and try uploading these images let's take the complex one first and it is showing it up here it is let's click on generate prediction and let's see how it comes wow so you can see that it is able to detect it one this one let me try out with some other images so we have a hand image with ag and see if that also works out so guys you guys can see that these are different resolution images so you can see the earlier image was having different width and height and this is different now let's generate the prediction so you can see the model is quite robust and it is predicting everything pretty well so here i'm going to keep it little bit fast forward and show you that if it is able to predict all the images pretty well yep i have already shown you how the front end is coming out and how it is talking with the model on back end now we will try to code this complete pipeline from scratch so i'm going to create a model from scratch and then we will deploy this model to this streamlit app and i will also tell you that how you can host your website with streamlit and have your model running on background and the user can go ahead and use this model anytime wherever he wants so first thing first let's talk about the data set so we are using this animal 10 data set over here which is available within kaggle and thanks to the developer of this data set he has taken around 20 000 images of animals within this data set all with the mapping so whenever you go to the kaggle logging to your account check out this annual 10 data set i have added a direct link to this data set in the description of this video and you can go ahead and download this data set there is a problem with this data set that it is having the names in not in english so the developer of this data set has also provided a translate dot py script which contains a dictionary of all the labeled images their english name and the other language name once you have downloaded this data set on your local drive because i do not have a big end gpu available within my laptop so i'm going to use the google colab notebook for training up our model on gpu so once you have downloaded this data set you need to just go ahead and upload your data set on google drive and inside google drive you can create a folder named as animal classification so this is the same account on which i used to create all video lectures so let me create a new folder over here named as animal classification and within this folder i'm going to so this is the archive file that i got so i'm going to upload this file within this folder meanwhile this data is uploading to our google drive we are going to have our google co lab ready to play with this data set and we are going to create a new notebook over here and within this notebook we will be having at first since we are only developing writing up the code we are not going to have a gpu instance because nowadays collab has kept a limit on your gp uses and if you are not using gpu for a long time it will stop it will start popping up those warnings that you are not utilizing gpu so we will go to the runtime and change the runtime to none okay since we are just going to test out or write out the basic script and create our data set ready for the model ingestion or the model training so guys we have already uploaded our data set in the google drive now this is the time to start our code so we will be importing some of the basic libraries like os we will have to import tensorflow hdf now we need to import some yep so instead of writing up our own architecture over here we will try to use the previously created mobile net architecture that we have used in couple of our other videos in this youtube channel and we already found that it performs pretty well and the size of the saved file is also pretty small so we will import that model from tensorflow keras dot applications start mobile mobilenet yep i'm going to import the v2 version over here because i have a good feeling about this model from my past experience that it is pretty small so we have written it incorrectly we have to write from import mobilenet v2 as we all know that these sort of transparent model they have their own preprocessing functions so we need to import that pre-process input also from the same from the same library now we will be needing some of the layers so let's import those layers okay tensorflow.keras dot layers import so we'll be needing our usually tense layer and we will be using con 2d we will be using global average pooling 2d and if i'm missing something yep input layer um yep that's all so all these layers now we will be using because we need to at least drop our model whenever we get a good validation accuracy so we'll be using some of the callbacks so let's import those callbacks keras import callbacks and we'll be using the optimizer also so put the optimizers we imported tensorflow we imported os yeah we will need numpy snp as we need to mount our google drive to this instance so we will import drive from google collab okay i just wrote google incorrectly we'll see if any package will be required in future okay from now the next thing we need to do is we need to mount this so we'll write drive dot mount and here we will give content slash drive so you'll click on this link it will ask for the authorization code go to link login to your account and you will get this authorization code paste it here and your drive will be mounted so let's see where we are we can do as it is running on the linux so we can do slash ls and you can see we are within the drive and it is showing drive and sample data here we will be using the magic command to get into the drive drive slash my drive slash our animal classification folder that we just created run this and now you are within the animal classification so once you are over here you have already uploaded your file so now you just need to unzip the file so we'll be using unzipped and then we have archive dot chip so you can see that i can run all the linux command with this slash in the front and once i will run this it is going to unzip all the files so as you can see it has started unzipping all the files and guys this is going to take up some time because it's a huge folder we have a lot of images saved within that chip folder so i will leave my laptop to run this command and will be back in a while once that is done so guys as you can see all our files are now inflated or unzipped this is the time to check out how the files are looking like on our google drive so we are going to log into our google drive and see how the files are coming up so right now as you can see we have this raw img file over here once i'll open this file you will have all the folders so we have all the folders over here you can see we have all the animals name and inside these folders we have those images saved yep you can see for dog we have these all images so our files are coming up pretty well now the only thing is that we have also this translate.py and if i open this translate.py you will be able to see that it has a dictionary which has the name mapping like k into dog kevlar to horse elephant a to elephant so these are mappings we will be using to change these directories name so the first thing we need to do we need to write a small python function which is going to use this dictionary and change all the file names within that folder now this dictionary have some issues and i'm going to talk about those issues in a while so let's clean this up now i'm going to comment this out so that we do not run in this code multiple times now this is time to write up a small python function to change those directory names so we'll be using os so we will be so we will be using os so let's write up a for loop for that for i in os dot list dir and inside that we have raw files because we have seen that folder name is raw the folder name is raw img so we'll write that raw slash img let's print this out so you can see all the folder names are coming up over here so these are directories are there within this within this folder so now as you want to change these file name based on those dictionary so let's import that dictionary so we can do import translate so we can do from translate import translate so this is a name of that file that python file that got created once we extracted this folder we are importing this dictionary from this file so let's see how this dictionary looks like so eventually you can see this dictionary now let's talk about the problem with this dictionary it has a issue with the keys and the pairs of the dictionary so right now you can see the butterfly is mapped to far fella on in the next side you have cane mapped to talk so whereas butterfly is the english name and farfella is the other language name here they are keys and values in the other ones they are values and keys so dog is on the other side so this is some sort of problem and i tried to change some part of this translate.py but i do not want it to have this file to give it to you and then you try on top of that so we will do some sort of cleaning on this script over here so we will use os dot rename we have raw slash img and inside that we have this plus i so this is the directory name that we wanted to change and we have the name that we wanted to give that we can write here raw slash img now this translate dictionary will use over here translate and inside that we will give this i so what is going to do that it is going to read out those names and then it is going to rename those files but the problem with this dictionary is that it is not going to rename it correctly so i tried it multiple times and just figured out that there are two names which are incorrect within the folder so i'll just write up a small code for that so we have let me just first print this out the name of the files within this folder and scotty pluto sorry from for my pronunciation it's not that great so let me just uh rename this file so this i'm going to do it independently meanwhile in other case what you can do that you can go to this translate.py and change this file name itself or change this dictionary itself within that folder within that file now here instead of the i am going to give rango we could have done it here itself now this rango i wanted to give name if you see what is the dictionary so we have the rango rango yep rai so if you see it's the diagno ragno over here and it's ragno and it's on the value side actually so it is actually a spider so let me just paste it from here and add it on here this spider now the other thing that we need to change is the total little sorry again let me just paste it over here and let me just change it from if you see our dictionary it is squirrel so i'm going to copy the sql and paste it over here so these files may come in between so we will put up a try and accept over here so we'll have try accept exception as e print e let's run this so you can see it has thrown up error now what it is saying that seems like we do not need to change this store till toe because it must be okay it's already there so we can just comment this out and let me just check how the files are looking now so i'll do ls then draw img and this is going to return me all the file names so you can see butterfly cat chicken cow dog elephant hot sheep spider squirrel so it has done its work we have all the files now in its english version the next we are going to do that we are going to split this complete data set into train and test so right now we are are all having these images in straight down the in the within this folder and also we wanted to calculate how many images are there because we do not want to have unbalanced sort of data set for model training uh let's do a sort check over here for i in so i'll just copy the code from here to down there now for each individual directory we wanted to check how many files are there so we'll do 4j in os less dir plus we'll put up a slash over here i so what it's going to do that it is going to go inside individual folder and there we will print out the length of okay we do not actually have to iterate so what we can do we will do length of os lstr so this is we are going to print out and what i will do i'll also print out the i over here sorry the i here now this is going to print out the directory name and the number of file within that directory let's run this okay we forgot to put up a bracket now run this you can see we have for dock we got 4863 images whereas for couple of others we have only 1000 devices and there are couple for elephant we got only 1446 images so we do not want to miss out any part and according to me 1446 images and i do not want to waste a lot of time in model training is good enough to have in each folder i am going to delete all those images which are more than 1446 so inside every single folder i am going to keep only 1446 images because i do not want unbalanced sort of data set while model training so there are issues with the models when you will have unbalanced sort of data sets in a way sense you can say if you got one class which is having a humongous amount of images and the other class which is having a very less number of images for an optimization algorithm it is just like it has to reduce the total error but your data set is not balanced so it will your model will be biased towards the class which is having higher number of images so always make sure that you are having equal number of images for each individual class or a very slight variation in number of images because obviously you do not want your model to get biased on one class so that's what we are doing over here we are going to remove all the images which are higher than 1446 in each individual folder we are going to keep only those number of images so guys firstly we were thinking to clean this folder itself but what we can do that we can have the data splitted into train and test and at the same time we will only take uh 1000 images for 1000 images for model training and around 400 or 400 approx images for model testing in that way we will have a good sort of split so let's do one thing have we are going to split our data set into train and test and for that we will need to create a train test directory so i'm going to write os.mkdir this is going to create a directory train and same i'm going to do with the test and inside those directories what we want to do that we are going we wanted to get into the folder of raw image and take first 1000 images in the train side and then 400 next images on the test side so we'll write up a loop over here so that loop will be like this only so now you know that we are getting dog horse and elephant so same sort of folders we need to create inside the train and test folders so we will just copy this strain command from here and here we will write slash plus i so this is going to create the folder within the train data set and the same thing we are going to do with the test one so now we will have all dock horse elephant all these sort of folders created within our directory now here we want to iterate also within the directory so we will have another loop inside that for j in os list dir and let me copy this one and this one we are going to iterate folder by folder so we'll have slash and i now this time we wanted to go first 1000 so we'll have 1000 till 1000 we'll go over here and here this is going to iterate on the first 1000 files within that folder and here it is going to create or move the file from my raw image let me just write this down raw image slash i slash j so this is a complete path raw image plus ith folder that jth image and here we wanted to move this to our train site so we'll have train here train plus it folder plus jth image now once this is done the first 1000 images within that folder will be moved so what is going to happen that suppose it got 1200 image within that folder you have removed the first 1000 image so now only 200 files will be remaining within that raw folder so appending up the logic what we will do that we will take next 400 images from here and we will move that to the test folder so here instead of the train we will just write test is quite straightforward what is going to happen that first it is going to though look at those 1000 image move those files into the train one and now apart from the 1000 the remaining files will remain within the raw image folder now it is going to check the next remaining images which are about 400 so this i took because we have the least number about 1446 so out of those if i remove 1000 we will have 446 and this is the lowest amount of image that we have the remaining 400 images that we are going to move into the test folder now hope we are very well done this one so let's run this and hope this is going to copy everything no no no we got an error so where is the error yep so we got error because we didn't add the slash so this is we need to add a slash over here and same thing we need to do on this part and same part we need to copy over here over here okay the path is coming correctly let's have a look again so we have it plus slash plus j plus i plus slash plus j m a j test okay let's run this now see what happened that we ran that code earlier so it has created those folder in the first try so we are going to get this error multiple times because those folders are already created within that directory so for surpassing that error i'm going to put up one try and accept and i know that what will be the error so i'll just put so i'll just put accept pass over here and same thing is going to happen with these directories because we have these are already created so we'll put try and we will put one except and we will just pass once because we know that the error will be just that we we already have a directory over there let's run this and see if our files are getting moved looks like it's working and our files are getting moved into train and test folder this is the only shot of pre-cleaning required for model training once you are done with this we are good for writing up the model code so guys here our training and testing images are splitted and if you want to check you can do ls test and this is showing that you have those folders created within the test folder and you can also confirm by going to your drive and you will have train test folders over here and you will have images saved within these folders now it is still opening up yep you can see the images now here comes the main modeling part so what we are going to do that we first have to use image data generator and i think we haven't imported it earlier so let's import it so from tensorflow dot keras dot pre-processing site image import load image and image data generator yep let's run it again i think okay this is i don't know how it's got there let's run this yeah so we have the image data generated now so we have discussed a lot about the image data generator in my other videos i'm not going to talk a lot it just for creating a labeled data set from those directories so how to use it we are going to create two generators one for our training another for our validation so we can we are not going to have a testing sort of over here because we will be utilizing those two generators to train up at the same time we will use it the other one as in validation and since we are more focusing on the deployment side i am not going to talk about the model diagnosis as we want to use this generator two three times in real life we will have three splits one for training other for validation other for testing so basically we usually create a function for this image data generator so let's create a function for this one def image data i'm going to give this name we'll write the arguments after writing it up since we are using a transfer learn model mobile net over here we will be using a preprocessing function so let's put up an argument on this one named as pre processing css ing pardon if i'm just writing up a typo just to variable name so this image data generator i want to keep it versatile so what i will do if preprocessing is true then we will have and generator object defined which will be the image data generator and inside that we will have so you can see it we have a preprocess argument over here and this preprocessing function we are going to pull within this one or else we are going to have this generator object without the preprocessing function so we will have a simply defined generator object now we will write gen underscore object let's define it so that we will get the argument so what i'm going to do i'm just writing it over here now this gen object we will be it will be faster to code out because we will be getting the helping argument so we have to use flow from directory because all our data is saved in form of directories and inside that you can see we need to give the directory path and so i'm going to give dir path now the other thing we need to give the target size so let's put it target size and the other part we need to put is the batch size batch size we will just keep it so right now i am defining it and i will just put it in on the top over here because we want to use this function two times for training and validation data set generator now after this patch size we have the class mode so class mode so this we are going to keep it sparse only now we will have class list so [Music] this is this will also be the argument of this one what we can do let me just split it down is equal to class list this one we will let me just change changes lst we can do this will keep it at an argument and ffle circle is equal to true i'll just take this and this complete thing we are going to return return from here yep i think we are good in shape let me just pull it all together so that it's looking up good bad size glass mode all these arguments we are going to put over here so directory path target size then we have batch size sorry batch then we have class list and let's do this basically the first argument so do not have to run this so you can see that our function is being created let's test this out with calling the train data generator gen now we'll call this function and inside that we will give the directory path which is train and the second thing we need to give the target size that is since we are using a transfer length model over here for transparent we have to give 224 cos 224 so these are the defined size for mobile net we can have other size for other short of models but right now we are using mobile net that's why i'm giving this then we have to give the batch size as we have thousand images or more than thousand approx images so i want to give a huge patch size around 500 and since we'll be using gpu it is okay to give now we will have to now we will have to give the class list and here in the class list i'm going to give the list of files within the directory so we just use list dir and inside that we will do train now after this we need to give the preprocessing okay miss this out we have a wrong comma over here so the pre-processing function we are going to use the mobilenet p processing function so i'll just copy it from the top here we have taken this preprocess input and let's give this preprocessing function over here okay let's test this out okay we have kept it within the else so we just need to take it out from the loop and run this since we do not have something we have some it is normal as classes let's test this out yep you can see it is working pretty well and we have our train data generator ready for model training or in the same way we'll have our validation data generator valid data chain and i'm going to take this complete thing paste it out instead of train i will have test and here again i will have test and i will run this so you can see we have splitted our data set and we have one we have 10 000 images for 10 classes and we have 4 000 images for 10 classes and this is a fully balanced data set because for every individual class we have 1000 images in a long shot we are good with model training data we have prepared all data set and this is the time to define our model as i told earlier we are not going to create any architecture we are going to take up the mobile net v2 architecture and i'm not going to write the code i will just do a google search yep so i'll just take this out from here and i'll just paste it over here and i will just write this down base model and this is the way we define uh transfer learned model in a simplest way so let me just create so we'll be using this uh architecture for our own data set so we need to remove the top layer so we'll put false over here and other arcs we will remove this kiosk from here softmax is correct now we do not need the classes let it let it be there and this way we have our base model defined one thing to call out over here we have to get the input shape that is 224 comma 224 comma 3 and yep let's run this yeah we are good now we do not want to train the layer of this model so we'll just put we'll just freeze this so that can be done with the trainable argument and we will put this as false so what this is going to do that it is going to freeze all the layer training for this base model we are going to put some additional layer on top of this model and we will only train those layers because it's a very big network and we we do not want to train each individual node of that network so let's add some layers on top of this base model we can have a model defined so tf dot keras dot models dot sequential now we will add model layers so we'll add this one model dot add and we'll just add our base model to this model we'll you will have this base model attached to your model now we can easily add layers on top of this one so whenever if you see the summary of this model let's let me just print this out what summary it's a big model and if you see the last layer it is having seven cross seven cross one two eight zero so we have a out value which is giving this big tensor out and we want to map this tensor to the 10 classes which are there in our data set so we will add some basic layers on top of this model the first one we wanted to have the global average pooling so i'll just go ahead and i'll just copy this global average pooling 2d to our model over here yeah so this is done and meanwhile how we are we have to put a bracket over here and this is done and while lighting up the layer we will keep on checking the model summary so you can see our global average pooling has reduced all those seven cross seven now we have only one two eight zero comma none now this can be mapped so we will can have the dense layer now on top of this okay we wanted to keep this and we wanted to keep in power of two so let's keep one zero two four that i have tried earlier and it worked pretty well let's see how it works here and we have to put the activation and that is will be value [Music] now once this is done now add up a soft max on top of this one and that soft mix should return us 10 classes and the activation should be soft max so let's see how the summary looks like yep so you can see we have 10 classes in our image data set and we are getting those ones and this is coming from 1 to 0 to 1 0 to 4 that is okay but we have a humongous amount of parameters over here and all these will be trainable and you can see the trainable parameters are around this one summed out to this one and all the other parameters from the base model we have freezed them and this is a way uh most of the people try to use transfer learning within that model but there i have seen couple of people freezing some amount of layer from the base model and keeping some amount of layers trainable that is also workable compile the model so we'll do model dot compile and here we are giving going to give the optimizer is equal to let's give adam moss so right now we are using image data generator so for that we usually use sparse categorical cross entropy and i have already explained what is what what is the meaning of sparse categorical cross entropy in my other videos if you wanted to check out those videos i have given link in the description and you will have clear gut idea that why we keep this sparse or sometime categorical cross entropy sometimes something else over here now the last part mattress so we have done some typo run this seems like our model is now compiled and this is the time to to to to have some so if you recall from the top we have imported uh some of the callbacks and the optimizers for our model early stopping and only saving the best model out so there is a straightforward code so you need to define two variables over here so first one will be the el st so this is for early stopping just put this callback start early stopping and here we need to monitor the validation loss so we'll just copy this argument from here and paste this out now how many p how much patience you want to keep how many iteration you want to wait patience will be will you want to wait for five and mode mode is equal to we want to minimize the loss that's it okay uh this should come within the quotes this is for our early stopping callback the other will be we wanted to create the checkpoint of the model after every iteration so say ck checkpoint and we want to change this to checkpoint model checkpoint and here we have to give some files file paths so we'll be saving in the same folder model weights wt dot s t f pi so here you can do two things you can also save your file as an h5 format as well as an sdi format doesn't make any change and you wanted to put save best only is equal to true and you wanted to monitor the validation loss monitor you'll have validation loss well loss and mode will be the min as you want to minimize the loss both our checkpoints are now created now it is not going to do overfitting of the models and also going to save the best model based on the validation accuracy the last part you have to do is model.switch and once you are done you here you need to give the training data generator train data generator and valley sorry train data generators now batch size we are going to keep the same 500 i think we have defined the same 500 over here and then validation validation data generator so that we have valid data generator over here and you have to provide the callbacks callbacks bracket inside this we have to give those elst elst and the save ck save ck now how many epochs you wanted to go i wanted to go about any box um let's check this is correct everything it looks like that run this hey here you can see the model training has started so i'm going to leave this out over here and come back after some time while this model gets trained so guys you can see that the model has completed the first iteration and it got a pretty good accuracy 72 percent on the training site and this is quite surprising we got very good validation accuracy even though the training was not that great but still keep on training and let's see how better we can achieve now since the first iteration has been completed so our model would have been saved in the google drive so let's go back to our google drive so here we are yeah you can see dot model dot wait dot sdi five we will just download this file and at the time right now we are going to write the streamlet application for our local environment from which we will be hosting up the web page so we need some model to be there so that we can just test this out so guys here is a small code that i have written down to create the ui based on streamlit and this i will upload on the github and i will give the link in the description so that you can just download this file and use it for your own so i'll explain this code line by line what is happening within this code and how the ui is getting generated so let me so let me go ahead and show you what our file this contains so we have the saved model folder which have those saved weights from the collab that we got after model training and then we have requirement.txt i think there is couple of more requirements we have cv2 also here and let me just check uh yep that's all so we have also cv over here so you have to run this requirement.txt and install all those libraries i'll just add the details about this in the github itself we can use it without any issues and let me show the main file now so here is the main script so what it is doing that is importing first all the libraries and after that it is going to the model and it is reading up that model at the start so here once that model is loaded within that model variable then you have this st file uploaded so guys this what it is doing that okay before we get into this part let me give a brief introduction about streamlit so streamlet is made on flask api which creates server and you will have a front end which is a website without two lines of code actually this much part of the code itself has created your front end of that web page and here it is saying that put up a file downloader box within that ui let me run it and show you if you want to just check this out i will just comment the complete code below to this one and show you how it is working so right now i'm over here so this is i'm running from the shell and i'm i have to just write streamlight run so whatsoever is the name of so it says streamlit host dot py and once you will launch this it is going to create a server and let's see running it i think taking up some time my computer is not so great so this once we have run this you can see it has started running uh localhost and you can get to this localhost by just one click over here and you can see it's running over here and only the part of the code that i have written let me go back so only this much part of the code was able to create a web page for you and in this web page you can see the application is right now running and it is right now loading up that model and you will have this box created for uploading the file and once you click on this box you can see that it is giving you a dialog box for uploading your files so very very straightforward to create the application now the second part of the code is we have a map dictionary where i have all those model maps which are like zero one two three four five six so these are the simple mapping of those uh of that image generator that we have used because we know that it converts categorical variables into numbers so these are this is the mapping and here if you go down yeah so here if you go down once you have clicked on that dialog box you have selected a file so this uploaded file have that variable or that file saved within that now if it is not none it has to go down and it is going to read up with the cv2 and this code actually is very very straightforward and can be found in the github repo and within this code so once once we have read out the file we are resizing the file to the desired shape so we know that our model takes 224.224 so that's why we are resizing our image to that shape now once this is done you are just showing that image to the streamlight window so whenever you wanted to show something within the streamlight window you have to write sd dot image and after that you need to give that image and the channels so this image is the cb2 image that is loaded over here so i just wanted to show that we are using different aspect ratios image that's why we haven't show the resized image within this sd.image instead of that we are showing the original image over here now once this is done we know that we our mobile net architecture takes the image after the pre-processing being done with the mobilenet pre-processing script so we are directly doing the pre-processing on top of this resized image and since we are we all know that it's a pretty straightforward that you need that extra access wherever you are generating the model predictions because the time it got trained you have a non dimension added to the model so once this is done you have a button over here saying that generate prediction and once that button is clicked it is calling up model.predict method and returning up the class using this alchemix method and you know that we have the index coming out with this archimex method so we need to give the proper label so that we are that we are taking up from the dictionary map dictionary that we have defined over here it has map for each and individual index so this is going to give you the label so right now we just made the changes and you can see that the changes would have happened so if you run so if you click on the rerun it is going to accommodate all those changes that you did with the script over here and you will be able to so it's a real time like you do some changes with the back end code and it gets reflected over here so if i will select the file now like this horse one now you can see the horse image is coming up and if you click on the generate prediction it is going to generate it is going to call out that model and then generate the prediction for this model so all this code is available on my github link given in the description if you like the video and if you want to check out more content like this don't forget to press the like share and subscribe button for this channel i will catch up with you in my next video till then bye bye and take care
Info
Channel: When Maths Meet Coding
Views: 22,720
Rating: undefined out of 5
Keywords: streamlit, tensorflow, model deployment, python, computer vision, model training, machine learning, deeplearning, colab gpu, gpu training, cuda, webapp, tensorflow model, keras
Id: VVXkbXPFzmM
Channel Id: undefined
Length: 58min 41sec (3521 seconds)
Published: Sun Apr 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.