WEBVTT

00:05.130 --> 00:06.550
Hi everyone welcome back.

00:06.680 --> 00:12.260
So in this video we're going to start implementation of the image classification API that we talked

00:12.260 --> 00:18.050
about in the previous video so you can see that I have a new folder called image classification which

00:18.050 --> 00:18.750
is empty.

00:18.800 --> 00:19.320
OK.

00:19.430 --> 00:25.460
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

00:25.460 --> 00:27.410
stuff like setting up the environment.

00:27.440 --> 00:31.160
And the doctor composed doc files and all that.

00:31.160 --> 00:31.670
OK.

00:31.910 --> 00:36.350
So first of all we're going to go into image classification so I want to go into desktop and then image

00:36.350 --> 00:38.090
classification.

00:38.090 --> 00:40.180
And then as you can see it's empty.

00:40.190 --> 00:41.480
So there is nothing in here.

00:41.510 --> 00:44.180
LS basically shows you what's in the folder.

00:44.430 --> 00:45.410
OK great.

00:45.530 --> 00:49.630
So the first thing is we want to have a doctor compose someone I don't touch.

00:49.780 --> 00:57.460
Dr. compose nice ammo and I not want to click and see if I can maybe make this a bit bigger.

00:57.470 --> 00:57.840
OK.

00:57.890 --> 00:58.900
So that's better.

00:59.180 --> 01:05.180
So Dr. composer yemo and then the second thing is I want to do two directory's one for the database

01:05.180 --> 01:09.180
for the users and one for their web application or the API.

01:09.200 --> 01:13.060
So what I do make directory a web and make their entry.

01:13.070 --> 01:15.770
Also do you mean OK so just as usual.

01:15.770 --> 01:23.720
Now I'm going to go into web and then I'm going to touch a doctor file because I need a doctor.

01:23.960 --> 01:29.600
And I'm also going to touch requirements dot text so requirements dot text.

01:30.140 --> 01:30.760
All right.

01:30.790 --> 01:37.280
And I'm going to go back and when I go into our database OCD give me.

01:37.430 --> 01:41.000
And then I want to also touch dog or I'm going to touch Nahor file.

01:41.060 --> 01:41.590
OK.

01:41.690 --> 01:46.850
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

01:46.850 --> 01:54.320
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.

01:54.470 --> 01:57.810
So we'll wait for a second for Adam to open.

01:58.520 --> 02:01.330
OK so now we have the full there here as you can see.

02:01.460 --> 02:03.380
So the first thing is let's first right.

02:03.380 --> 02:05.670
The darker files should be fairly straightforward.

02:05.690 --> 02:07.520
Now we've done it a couple of time.

02:07.610 --> 02:09.450
So version is three.

02:09.620 --> 02:10.230
All right.

02:10.310 --> 02:13.160
We have these several services.

02:13.160 --> 02:19.470
The first services is WEP and we can build it from DOT or no.

02:19.500 --> 02:20.530
No comment.

02:20.590 --> 02:23.400
Here's a dot slash to the docket file.

02:23.440 --> 02:24.920
This service is here.

02:24.980 --> 02:25.910
That's it.

02:26.210 --> 02:26.970
OK.

02:27.170 --> 02:34.370
Now there is also reports we want to open some ports and that is going to be mapping 5000 into find

02:34.390 --> 02:34.720
out.

02:34.760 --> 02:35.640
OK.

02:36.020 --> 02:41.000
We're also going to put links because what I want to link it with the database and then I'm just going

02:41.000 --> 02:49.750
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

02:49.760 --> 02:52.700
of that's the docker file for databases here.

02:52.700 --> 02:53.240
All right.

02:53.330 --> 02:58.940
So this should be straight forward with died a couple of times already right now let's go back let's

02:58.940 --> 03:02.350
go into the dug into the Duggar file off D-B.

03:02.530 --> 03:11.180
Race should be only one one one line which is getting that from Dr. Howe the image for Mongo IDB some

03:11.180 --> 03:16.220
light from Mongo then semi-colon and then three point six point four.

03:16.220 --> 03:20.860
Now there's a newer version at the time you're viewing this video then you might you might use it.

03:20.990 --> 03:24.380
Usually Mongo doesn't change the API that much.

03:24.650 --> 03:25.530
OK.

03:25.760 --> 03:30.660
Now we're going to go to a doctor file for the web which is has a couple more lines of code right.

03:30.830 --> 03:32.140
So the first thing is.

03:32.210 --> 03:37.670
Again we need bison right where we've been talking mice and all this time so we need bison and then

03:37.670 --> 03:43.010
we're going to change the word directory to slash user slash source slash.

03:43.520 --> 03:49.350
And then we also need to copy the requirements or copier requirements that text.

03:49.370 --> 04:02.610
And we also need to run build install and then no cache directory are and then requirements that text.

04:02.630 --> 04:03.320
OK.

04:03.530 --> 04:09.260
So we're we're installing the requirements which we're going to write in a few seconds and then after

04:09.260 --> 04:15.470
that we copy the files from here from this folder into the work directory which is that slash slash

04:15.470 --> 04:16.870
or slash app.

04:16.940 --> 04:26.230
And then finally rerun is command Python and then add up you guys are running the the the act up the

04:26.240 --> 04:27.630
file at the Pew.

04:27.740 --> 04:34.120
So you forgot to write to add this year so I'm going to go quickly and going to web.

04:34.300 --> 04:37.310
And then I want to touch act up.

04:37.430 --> 04:39.220
So when I add the file at that view.

04:39.380 --> 04:44.320
So after it's done and you solve all the requirements it's going to run out of fuel.

04:44.390 --> 04:49.100
Now for the requirements we're going to need a couple of things and you will see that I introduced a

04:49.100 --> 04:51.150
couple of new ones.

04:51.350 --> 04:58.580
So we run the flask as usual and flask for us because that's how we you know program our stuff or our

04:58.580 --> 05:06.610
API and then we also need by Mambo to access the database and then recreate for the words but then this

05:06.610 --> 05:08.600
time are going to add some new stuff we're going to add.

05:08.600 --> 05:13.180
No not by an hour on some times people call it Lumpy.

05:13.220 --> 05:16.380
OK so you can choose whichever pronunciation you like.

05:16.460 --> 05:22.460
And then we're also going to choose denser flow which is the deep learning framework or library that

05:22.910 --> 05:26.800
Google developed and then we're also going to change requests.

05:26.960 --> 05:31.970
So what are what are these what come by and Tanzer flow work together.

05:32.000 --> 05:32.500
Right.

05:32.720 --> 05:35.370
Tancer flow mostly needs non-high arrays.

05:35.470 --> 05:40.960
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

05:40.970 --> 05:44.310
you can think that tensor flow underneath it needs Nonno.

05:44.360 --> 05:51.920
OK so we're just going to add it as a requirement now denser flow is where we would load the model that

05:51.920 --> 05:55.750
was already trained to do image classification.

05:55.790 --> 06:01.430
On the on the number pi arrays that were going to be it OK on the images that were going to be feeding

06:01.430 --> 06:02.350
it.

06:02.420 --> 06:10.280
Now the final thing is requests and if you remember requests is going to be used to because the user

06:10.280 --> 06:17.070
is going to give us a you are our right so HTP and then something something that you speciate right.

06:17.240 --> 06:19.790
So the user is going to give us your image.

06:19.880 --> 06:25.770
What we need to do is to this is to download this image and to save it on our device.

06:25.790 --> 06:26.440
OK.

06:26.600 --> 06:33.490
So the way we do this is using requests so requests have something called or requests that I get.

06:33.670 --> 06:34.000
OK.

06:34.010 --> 06:41.090
So it has a get function and you basically give it your elso HTP and then something something else.

06:41.150 --> 06:43.160
So something something done.

06:43.170 --> 06:49.520
JP And then what it does it gets that they download this image for you automatically and you can access

06:49.520 --> 06:49.840
it.

06:49.880 --> 06:55.830
I knew r is equal to requests doget than I can say our content.

06:55.880 --> 07:01.350
And then I have or Ardai content and then I have whatever I downloaded there from this link.

07:01.370 --> 07:01.990
OK.

07:02.180 --> 07:04.910
So we're going to use this to basically download the image.

07:05.000 --> 07:10.440
And then after we download the image we're gonna use denser flow to predict what that image is.

07:10.550 --> 07:16.880
And then finally we're going to we're using We're not using fiber tensor flow is using by under the

07:16.880 --> 07:18.830
hood to do some of the computation.

07:18.890 --> 07:19.530
OK.

07:19.670 --> 07:23.250
So hopefully let's just delete this and this is a request.

07:23.450 --> 07:24.400
With an ass.

07:24.440 --> 07:29.150
Let me just maybe zoom in on this for you.

07:29.330 --> 07:30.080
Might be better.

07:30.110 --> 07:30.890
OK.

07:31.190 --> 07:32.350
All right cool.

07:32.360 --> 07:39.340
So now we written the requirements that text the docker file and we and the doctor compose files.

07:39.400 --> 07:44.180
Ok so now what's left for us is to start to implement the D-y file.

07:44.180 --> 07:44.670
OK.

07:44.810 --> 07:50.280
So we're going to stop here and in the next video we're gonna start implementing the application.

07:50.300 --> 07:56.680
And with time I'm going to show you how we can we're going to go to the Google official Web site and

07:56.700 --> 08:05.080
get out for the Tancer flow and we're going to download the model redone and put the model in our if

08:05.320 --> 08:10.250
we're going to download the model and put it in our Web site so we can access it.

08:10.250 --> 08:16.640
If you remember we did the same thing to a.p so we added it here so we can access it from amped up.

08:16.690 --> 08:17.360
OK.

08:17.660 --> 08:24.140
So you hope that hopefully this made made sense and honest up here and we're going to pick up in the

08:24.140 --> 08:24.680
next video.

08:24.710 --> 08:26.640
So until the next video happy Cody.
