WEBVTT

00:05.140 --> 00:06.730
Hi everyone and welcome back.

00:06.920 --> 00:13.910
So in this new series of videos we're going to be implementing a new API which uses machine learning

00:13.910 --> 00:15.500
to classify an image.

00:15.770 --> 00:20.390
So the idea behind what we're going to do is we're going to be given an image.

00:20.420 --> 00:24.750
So let's say this is an image and was a person inside.

00:24.920 --> 00:27.440
So excuse my horrible drawing.

00:27.800 --> 00:32.320
But then the image would have some things that it might have an animal that might have an airplane.

00:32.330 --> 00:35.690
You know it might not have anything that might have even the SOMEONE WHO famous.

00:35.690 --> 00:39.840
For example Angelina Jolie or someone or some other person.

00:39.860 --> 00:40.570
OK.

00:40.640 --> 00:45.580
And then we're going to give this model this image into our API.

00:45.620 --> 00:48.590
The user is going to give this image into our API.

00:48.830 --> 00:50.740
And then we're going to do some machine learning.

00:50.780 --> 00:51.630
OK.

00:52.130 --> 00:57.330
And then we're going to classify this image into one of five categories.

00:57.380 --> 01:01.490
So we're going to tell the user hey this is probably a person.

01:01.940 --> 01:05.450
And 80 percent sure about that.

01:05.600 --> 01:12.140
This might be a pineapple and I am one percent sure about that.

01:12.260 --> 01:15.870
This might be a famous person OK.

01:17.010 --> 01:18.620
And that I'm sure about that.

01:18.630 --> 01:20.260
For example 15 percent.

01:20.420 --> 01:22.020
And this might be an animal right.

01:22.030 --> 01:29.910
Somehow somehow the model classifies as animal 3 percent and then I notice this might be something else

01:29.970 --> 01:31.350
x 4.

01:31.350 --> 01:34.800
So we have 80 percent and then 4 percent plus five.

01:34.800 --> 01:35.700
That's 19.

01:35.700 --> 01:39.960
So 19 plus eight is ninety nine so one percent is x.

01:39.970 --> 01:40.680
Ok.

01:40.800 --> 01:44.130
So are going to be given this image over here.

01:44.130 --> 01:47.050
We're going to do some machine learning using Genser flow.

01:47.130 --> 01:53.880
So Tanzer flow which is a library for deep learning that was published by Google.

01:53.910 --> 01:58.920
So we're not going to be training our own model or are you going to use one of the models that Google

01:58.920 --> 01:59.690
already trained.

01:59.690 --> 02:03.810
It's called N.S. v3.

02:04.000 --> 02:04.580
OK.

02:04.780 --> 02:11.290
So inception B-3 is a very strong model and is able to classify an image into one of these classes for

02:11.510 --> 02:13.420
those too many classifications.

02:13.420 --> 02:20.620
I'm going to show you the model in a few seconds but it can basically classify animals plants humans

02:20.650 --> 02:26.710
famous people airplanes you know non-human things and so on.

02:26.710 --> 02:32.800
So it's a really powerful model that we can just use automatically since Google already trained it so

02:32.800 --> 02:38.230
we can just use it somehow like an API you can think of it as we're using this as an API and we're going

02:38.230 --> 02:41.260
to see how we can use it in the coming video.

02:41.290 --> 02:46.350
And I'm also going to explain tensor flow a little bit just the workflow of how it flow works.

02:46.360 --> 02:53.290
So we are more you know we understand how everything would work basically in in our API.

02:53.800 --> 02:59.380
Now in this video we're going to first of all introduce it we introduce what we're here to do so we're

02:59.380 --> 03:07.250
going to be building an image classification API or image classification API.

03:08.050 --> 03:14.560
And in fact if you Google just an image classification API or image recognition API you're going to

03:14.560 --> 03:17.610
find hundreds of Abiah ised that or any do this.

03:17.740 --> 03:21.540
And you know they might have even used section B-3 under the hood.

03:21.580 --> 03:22.410
So you never know.

03:22.420 --> 03:23.040
Right.

03:23.050 --> 03:29.590
So in fact there are many startups actually doing this service as an API so they offer an API and so

03:29.590 --> 03:31.120
an API would be here.

03:31.120 --> 03:33.400
So the user would access this API.

03:33.490 --> 03:38.300
And then you would get a response of this result right away so he doesn't have to do all this machine

03:38.360 --> 03:40.520
learning or heavy lifting.

03:40.600 --> 03:41.410
If you mean it.

03:41.540 --> 03:42.480
OK.

03:42.550 --> 03:49.630
So yeah this is this is actually very much like real world scenarios where you might be asked to develop

03:49.630 --> 03:51.390
an API that does something like this.

03:51.430 --> 03:52.520
OK.

03:52.660 --> 03:57.040
All right so the second thing we're going to do in this video is to do a chart protocol right where

03:57.130 --> 04:01.730
we want to do a protocol off all the resources that we have.

04:01.780 --> 04:02.470
OK.

04:02.620 --> 04:05.460
So we're going to do this very very simple great rehab.

04:05.470 --> 04:08.500
We're going to have three things we're going to have to register.

04:08.890 --> 04:09.480
OK.

04:09.610 --> 04:12.880
And as you might have guessed it's just registration.

04:12.880 --> 04:19.810
We're also going to have to classify OK to classify an image.

04:19.810 --> 04:20.480
What is it.

04:20.500 --> 04:22.180
You know what's in that image.

04:22.240 --> 04:25.160
And then finally I'm going to also add refill.

04:25.180 --> 04:25.850
OK.

04:26.170 --> 04:32.620
So we've already done refill in a previous video but we're also going to do it again to basically.

04:32.650 --> 04:39.520
So when the user registers he gets let's say 5 tokens for free so he can use our classification API

04:39.520 --> 04:40.730
for five times.

04:40.960 --> 04:47.850
But then once he's out of these five he can pave basis and then in return the administrator of the EPA

04:47.850 --> 04:51.360
I can refill his points for this user.

04:51.900 --> 04:56.070
OK so these are the resources I should have written is resources here.

04:56.080 --> 04:57.680
Now what about the your l.

04:57.730 --> 05:04.860
Well L is pretty pretty straightforward right for a register is going to be slash register for classifieds

05:04.880 --> 05:07.090
going to slash classify.

05:07.480 --> 05:10.190
And for a refill it's going to be last refill.

05:10.360 --> 05:11.210
OK.

05:11.850 --> 05:12.340
All right.

05:12.340 --> 05:13.750
So what about the method.

05:13.760 --> 05:16.600
Or is it a get post what is it.

05:16.780 --> 05:19.510
Well for registration was actually right.

05:19.510 --> 05:20.730
The parameter is first.

05:20.770 --> 05:22.750
OK so are there any parameters.

05:23.020 --> 05:33.040
So for arrester I need the username and the password and all that user right for classify I need the

05:33.040 --> 05:40.240
user name password to verify that he's actually the one he he's the same username right.

05:40.240 --> 05:46.020
Or otherwise I can use someone else's user name and someone else's tokens to classify my own images

05:46.020 --> 05:46.740
right.

05:46.740 --> 05:51.900
So we're going to use the get the username password and we're also going to get it you are.

05:52.020 --> 05:56.050
OK so this you are going to be your out to the image.

05:56.070 --> 06:02.190
Right so it's age DGP something something to puji for example OK.

06:02.250 --> 06:04.280
And then this is the image on the Internet.

06:04.290 --> 06:07.620
And we're going to download it and classify that image for the user.

06:07.620 --> 06:08.400
OK.

06:09.090 --> 06:11.130
For the refill it's straightforward.

06:11.130 --> 06:15.760
We have the user name the admin password right.

06:15.780 --> 06:18.840
Because we don't want anybody to be able to refill this.

06:18.870 --> 06:25.350
Any user with any number of tokens right or otherwise you would be at the point of refilling right.

06:25.350 --> 06:30.060
You just keep refilling your account for it with an incident number off of tokens.

06:30.360 --> 06:31.610
And then finally the amount.

06:31.630 --> 06:35.420
OK how many points or how many tokens do I want to add to this user.

06:35.640 --> 06:36.540
All right.

06:37.020 --> 06:38.340
OK cool.

06:38.340 --> 06:40.220
Now let's talk about the method.

06:40.240 --> 06:43.100
You can see that all of them require parameters.

06:43.090 --> 06:45.640
Right we have to send something to the server.

06:45.750 --> 06:48.920
And so in these cases we're going to use posts for all of them.

06:48.990 --> 06:49.490
Right.

06:49.620 --> 06:52.620
Because post is when we want to send something to the server.

06:52.710 --> 06:56.680
So post post and post.

06:56.760 --> 06:57.330
All right.

06:57.330 --> 06:59.950
So the final thing is the return codes.

07:00.030 --> 07:00.590
OK.

07:00.630 --> 07:04.020
So the return codes were statuses and so on.

07:04.440 --> 07:12.110
So all of them or as you might have guessed they have all hands 200 OK 200 OK and 200 OK.

07:12.120 --> 07:12.650
Right.

07:12.690 --> 07:16.120
That's if nothing no problems happen.

07:16.290 --> 07:20.070
Now in registration we might have another problem we might have 3 0 1.

07:20.130 --> 07:28.620
And we discussed this three and one here would mean that user name already exists already exists.

07:28.620 --> 07:32.180
So it's an invalid username here.

07:32.250 --> 07:33.160
We might also.

07:33.160 --> 07:39.830
So so we can shorten this three to one as invalid username.

07:39.870 --> 07:41.140
OK.

07:41.940 --> 07:45.230
Again to classify it we might have three in one.

07:45.270 --> 07:49.790
Someone might send that username is ABC and there's no ABC in our database right.

07:49.790 --> 07:51.510
The user doesn't exist.

07:51.510 --> 07:55.800
So three or one invalid username.

07:55.970 --> 07:57.250
OK.

07:57.750 --> 08:00.490
What about the password username password.

08:00.510 --> 08:01.940
Well they might not match right.

08:01.940 --> 08:06.930
I might my Bashford might be secure but someone sends ABC.

08:06.930 --> 08:08.600
Right so it's not my password.

08:08.640 --> 08:11.370
So 1:57 is invalid.

08:12.130 --> 08:19.280
Password and then the final thing is three or three what if he classified wait why did the username

08:19.290 --> 08:21.050
is correct the password is correct.

08:21.210 --> 08:24.720
But hey you wants to classify an image but you doesn't have enough tokens.

08:24.750 --> 08:27.610
He needs to refill though he needs to pay first.

08:27.690 --> 08:35.130
So in this case we send them back to 3 0 3 and then we tell him sorry out of tokens again out of tokens.

08:36.560 --> 08:37.550
All right.

08:37.700 --> 08:39.010
Now for the refill.

08:39.020 --> 08:41.260
We have something similar for the username.

08:41.270 --> 08:46.380
Well you might put a user name who doesn't exist in our database so it's an invalid user him.

08:46.490 --> 08:50.570
So there are three or one invalid username.

08:50.660 --> 08:55.500
OK so that means that this user is not doesn't exist in our database.

08:55.500 --> 08:57.690
Another one might be three or four.

08:57.740 --> 09:03.080
So if I send an admin password if I'm a hacker trying to hack into the ABC I refill my account with

09:03.080 --> 09:05.410
an infinite number of tokens.

09:05.430 --> 09:09.230
Then if this admin password is correct then I won't need to donate.

09:09.230 --> 09:11.150
Sorry this is a wrong password.

09:11.150 --> 09:16.240
So three or four invalid and password.

09:16.300 --> 09:22.220
OK administrator password and then that's it for now.

09:22.290 --> 09:27.750
You can also you know do an extra thing where the amount has to be positive.

09:27.980 --> 09:33.440
But then again the only person who is going to be using this slash refill is the administrator of the

09:33.440 --> 09:34.130
API.

09:34.220 --> 09:38.100
So most probably he's not going to implode like negative 5 for the end.

09:38.200 --> 09:41.920
And he is most probably going to end but five he doesn't want to break the system.

09:42.200 --> 09:48.080
So usually these checks are invalidations you put them just to make sure that nothing happens or no.

09:48.100 --> 09:51.760
Nobody tried to keep your system basically secure.

09:52.070 --> 09:54.740
So this is basically the API for for it.

09:54.740 --> 09:57.900
So registration we already did that before and the Riggio were about.

09:57.920 --> 10:03.590
We already did that before so we should go through them fairly quickly without too much explanation.

10:03.670 --> 10:08.210
But for the classification here well this is the interesting point because we're going to be getting

10:08.240 --> 10:09.130
your l.

10:09.220 --> 10:15.590
Sorry going to download this image and then we're going to fly the machine learning model that Google

10:15.590 --> 10:19.960
already trained on it and then we get the results and we return it to the user.

10:20.000 --> 10:20.670
OK.

10:20.840 --> 10:22.960
So hopefully this made sense.

10:22.970 --> 10:28.330
So we're going to stop here and in the next video we're going to take off and start implementation of

10:28.340 --> 10:34.410
the entire you know structure of the folders and our files doc and compose and so on.

10:34.820 --> 10:36.100
So yeah we're going to stop here.

10:36.110 --> 10:38.180
And until the next video happy coding.
