Hi everyone welcome back.
So in this video we're going to start implementation of the image classification API that we talked
about in the previous video so you can see that I have a new folder called image classification which
is empty.
OK.
So we're just going to make a new folder work in and then we're going to go in and start doing the usual
stuff like setting up the environment.
And the doctor composed doc files and all that.
OK.
So first of all we're going to go into image classification so I want to go into desktop and then image
classification.
And then as you can see it's empty.
So there is nothing in here.
LS basically shows you what's in the folder.
OK great.
So the first thing is we want to have a doctor compose someone I don't touch.
Dr. compose nice ammo and I not want to click and see if I can maybe make this a bit bigger.
OK.
So that's better.
So Dr. composer yemo and then the second thing is I want to do two directory's one for the database
for the users and one for their web application or the API.
So what I do make directory a web and make their entry.
Also do you mean OK so just as usual.
Now I'm going to go into web and then I'm going to touch a doctor file because I need a doctor.
And I'm also going to touch requirements dot text so requirements dot text.
All right.
And I'm going to go back and when I go into our database OCD give me.
And then I want to also touch dog or I'm going to touch Nahor file.
OK.
So now I have the dog or file in there now when I go outside and then I'm going to open all of this
an atom gate so I can edit it to sort of add to it and put my password and it should be good to go.
So we'll wait for a second for Adam to open.
OK so now we have the full there here as you can see.
So the first thing is let's first right.
The darker files should be fairly straightforward.
Now we've done it a couple of time.
So version is three.
All right.
We have these several services.
The first services is WEP and we can build it from DOT or no.
No comment.
Here's a dot slash to the docket file.
This service is here.
That's it.
OK.
Now there is also reports we want to open some ports and that is going to be mapping 5000 into find
out.
OK.
We're also going to put links because what I want to link it with the database and then I'm just going
to put DP Now I write this service for TB which is build I'm going to build it from dot slash D-B case
of that's the docker file for databases here.
All right.
So this should be straight forward with died a couple of times already right now let's go back let's
go into the dug into the Duggar file off D-B.
Race should be only one one one line which is getting that from Dr. Howe the image for Mongo IDB some
light from Mongo then semi-colon and then three point six point four.
Now there's a newer version at the time you're viewing this video then you might you might use it.
Usually Mongo doesn't change the API that much.
OK.
Now we're going to go to a doctor file for the web which is has a couple more lines of code right.
So the first thing is.
Again we need bison right where we've been talking mice and all this time so we need bison and then
we're going to change the word directory to slash user slash source slash.
And then we also need to copy the requirements or copier requirements that text.
And we also need to run build install and then no cache directory are and then requirements that text.
OK.
So we're we're installing the requirements which we're going to write in a few seconds and then after
that we copy the files from here from this folder into the work directory which is that slash slash
or slash app.
And then finally rerun is command Python and then add up you guys are running the the the act up the
file at the Pew.
So you forgot to write to add this year so I'm going to go quickly and going to web.
And then I want to touch act up.
So when I add the file at that view.
So after it's done and you solve all the requirements it's going to run out of fuel.
Now for the requirements we're going to need a couple of things and you will see that I introduced a
couple of new ones.
So we run the flask as usual and flask for us because that's how we you know program our stuff or our
API and then we also need by Mambo to access the database and then recreate for the words but then this
time are going to add some new stuff we're going to add.
No not by an hour on some times people call it Lumpy.
OK so you can choose whichever pronunciation you like.
And then we're also going to choose denser flow which is the deep learning framework or library that
Google developed and then we're also going to change requests.
So what are what are these what come by and Tanzer flow work together.
Right.
Tancer flow mostly needs non-high arrays.
OK so if you want to run denser flow you can think of now by we're not going to use not by here but
you can think that tensor flow underneath it needs Nonno.
OK so we're just going to add it as a requirement now denser flow is where we would load the model that
was already trained to do image classification.
On the on the number pi arrays that were going to be it OK on the images that were going to be feeding
it.
Now the final thing is requests and if you remember requests is going to be used to because the user
is going to give us a you are our right so HTP and then something something that you speciate right.
So the user is going to give us your image.
What we need to do is to this is to download this image and to save it on our device.
OK.
So the way we do this is using requests so requests have something called or requests that I get.
OK.
So it has a get function and you basically give it your elso HTP and then something something else.
So something something done.
JP And then what it does it gets that they download this image for you automatically and you can access
it.
I knew r is equal to requests doget than I can say our content.
And then I have or Ardai content and then I have whatever I downloaded there from this link.
OK.
So we're going to use this to basically download the image.
And then after we download the image we're gonna use denser flow to predict what that image is.
And then finally we're going to we're using We're not using fiber tensor flow is using by under the
hood to do some of the computation.
OK.
So hopefully let's just delete this and this is a request.
With an ass.
Let me just maybe zoom in on this for you.
Might be better.
OK.
All right cool.
So now we written the requirements that text the docker file and we and the doctor compose files.
Ok so now what's left for us is to start to implement the D-y file.
OK.
So we're going to stop here and in the next video we're gonna start implementing the application.
And with time I'm going to show you how we can we're going to go to the Google official Web site and
get out for the Tancer flow and we're going to download the model redone and put the model in our if
we're going to download the model and put it in our Web site so we can access it.
If you remember we did the same thing to a.p so we added it here so we can access it from amped up.
OK.
So you hope that hopefully this made made sense and honest up here and we're going to pick up in the
next video.
So until the next video happy Cody.