Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1
Hello and welcome to the homework of much of one face recognition.
2
So this homework was about building a computer vision application that can detect smells which can be
3
very useful today as indeed some businesses consist of building some computer vision tools to understand
4
customers reactions when for example they're watching a movie.
5
So it is widely used in the cinema industry in the movies industry.
6
Some companies indeed use some computer vision tools to recognize customers expressions when they're
7
watching a movie to understand what makes them smile what makes them sad.
8
What makes them have strong emotions so that they can understand the customers.
9
And then for example recommend some new movies which will boost their emotions.
10
So today we're going to do exactly that but only with the small part.
11
We're going to make a computer vision tool that will detect when a person is smiling.
12
And now I get to say congratulations to the people who managed to make this smile detector but also
13
I want to congratulate the people who tried to do this homework.
14
Trying is also very important by trying always progress.
15
We always learn some things even if we don't succeed.
16
So what matters is to try hard.
17
So on that note we're going to start the solution of this homework and the solution of this homework
18
will include everything from the research phase.
19
Because indeed when you are a computer vision scientist or even a machineries scientist or an AI engineer
20
Well there is always the research phase to look for some solutions.
21
So I included this research phase in the Statoil and this research phase consists of finding the hard
22
cascade that will help us build this smell detector and then of course we'll proceed to the implementation
23
phase and we'll of course use the previous code to be more efficient and then eventually we will watch
24
the result in phase 3 we will notice that this is not optimal and therefore in Phase Four we will try
25
to improve the code improve the computer vision application to make a much more accurate smell detector.
26
So let's do this let's start with Phase 1.
27
The research phase.
28
So as you can see I'm on Google right now.
29
We're going to do our research online to find the right cascade to detect this mouse.
30
And so what I'm going to do.
31
And actually we'll find a place where you have all the heart cascades in case some of you were wondering
32
about that.
33
So what I'm going to do I'm going to type here open see the heart cascade it's actually the first here
34
open city the cascade.
35
Let's do this and let's see what we get.
36
OK.
37
So we had a couple of links.
38
The first one is some open city conditions on the open sea website.
39
That's not what we're interested in.
40
Then the second one is still in the open with the condition but that's still not what we're interested
41
in because that's not where we'll find the heart cascade.
42
However on the third link we might have something interesting.
43
This third link is actually the good herb repository of open city.
44
So if we click on the link What will we find.
45
Well we will find all the different Ahar cascades that are allowed to detect features.
46
Most of them are phase features not only human face features but also as you can see cat face features.
47
This one for example can detect the frontal face of a cat.
48
So if you have a cat you can play with it.
49
And also it can detect some weird things like as you can see Russian plate number.
50
So why not if you're in Russia.
51
Well feel free to practice to make a tool to detect Russian plate numbers.
52
And what do we see in all these Hargus games.
53
We see the heart cascade smiled at X-amount and that's the one we'll use to build our smell detector.
54
But you're going to see that it's not that easy.
55
We will need to change some parameters in the implementation to make it work better.
56
So that's the first step of this homework finding the Harker's get smothered ex-MIL Congratulations
57
if you reached that step that's already exent.
58
So now how do we extract this Hargus gate if some of you try to make Right-Click and then do something
59
like Save Link as well.
60
This will not work.
61
The best way to extract that Hargus gate is to open it.
62
I just clicked on it that should open right now.
63
There we go.
64
And inside you will find the whole heart cascade ex-MIL for the smell.
65
And so what you can do then is copy all this texture and the Epogen way to do this is to scroll down
66
all the way down and then press the shift key and then click again to select everything.
67
Then you copy and paste it in a text editor and you save your file by giving the following name cascade.
68
And of course now that ex-MIL this will work for sure you will make sure I have the right Hargus get
69
X amount as smell.
70
And so that's exactly what I did.
71
I copied that pasted it in a text editor and saved it under this name.
72
And so now what we're going to do is open an eye on that because again I really want to make sure you
73
don't forget to connect to the virtual platform.
74
So there we go.
75
Let's do that right now so we don't forget virtual platform that I remind contains all the packages
76
pre-install to to all the computer vision models that we will implement in this course and then we're
77
going to launch spider and I'm going to show you what I prepared so I prepared actually a folder a homework
78
folder and module one that contains this horrid cascade ex-MIL for the smile that we just made.
79
And so now let's go to Val Explorer.
80
Let's go to the folder that contains your computer vision.
81
It is Zed.
82
I'm taking this for that though because in module 1 I added a new folder a new subfolder that I called
83
homework and that contains this new hard cascade underscores now that SML that I've created this homework
84
folder will be provided in the next tutorial which will have the form of an article and you will get
85
this homework folder that contains the four files here.
86
The first two files you recognize them are X-amount for the eye and the face because we will still be
87
detecting the eye and the face but then it contains just new Hargus gate x.
88
For the smile and the homework solution that is open right now and inside which we will implement the
89
solution.
90
All right.
91
So if you're ready let's proceed to face to the implementation.
92
All right.
93
So as I said in the beginning of this oil we're going to do that efficiently and to do that efficiently
94
we're going to take our face recognition code that we implemented through all the module one where we
95
detected the face and the eye.
96
And we're going to simply copy paste the whole code.
97
I'm copying it right now and I'm going to close this because we don't we won't need it anymore and I'm
98
going to paste this code inside the homework solution.
99
So good news.
100
Now we simply need to add something that will detect a smile in my face and your faces of course.
101
So according to you what do we need to do now.
102
Well as you can see in the first code section we load the Cascades.
103
So as you might guess we need to load the cascade for the smell and that's exactly what we're going
104
to do.
105
But before we do that let's not forget to go back to the homework folder because that's the working
106
directory folder we need to be in that folder because it contains this Melkus Kate.
107
So what I'm going to do now I'm going to copy this line pasted below and replace.
108
I cascade by a new object that will represent the small cascade itself.
109
And so I'm going to rename it.
110
Smile cascade.
111
And of course what do I need to do.
112
I need to change the input here by the right input and the right input is no longer Hargus good.
113
I SML it is hard cascade smal SML.
114
Perfect.
115
Now we have this Marcus Gade.
116
We not only have the SML we also have to smoggiest get great.
117
The next step let's move on to the second code section here where we define that function that will
118
do the detections.
119
And so inside this function we need to add the code that will detect a smell in the face or multiple
120
smells if there are multiple faces and draw the rectangles around the smell.
121
So there we go.
122
Let's do this according to you do we need to do that in the reverential of the face like we did with
123
the eyes.
124
Well the answer is of course yes because we cannot have a smell if we don't have a face.
125
So I'm going to copy the three lines here.
126
That corresponds to the detection of the eyes.
127
And I'm going to paste that here right.
128
So these are the same that correspond to the direction of the eyes.
129
And then we're going to make the right replacement to make the detection of this mouse.
130
So the first thing that we need to do is replace this object here by smells smells it will contain.
131
I remind the coordinates of the upper left corner of the rectangle that will detect this mouse.
132
If there are several smells in the videos that is if there are several faces and so this object contains
133
the coordinates of the upper left corner of the rectangles detecting this mouse and also the width and
134
the height of each of these rectangles.
135
OK.
136
So smells this is not an object of I cascade.
137
But this time smile cascade.
138
And from Smout cascade we used to detect multi-skilled method that will apply on the gray region of
139
interest which is the region of interest of the face with a skin factor on 1.1 and a minimum number
140
of neighbors of three.
141
So that's fine.
142
Let's keep that for now and we'll see what happens.
143
All right then we start this new loop that will iterate through the different eyes but smiles that are
144
in the video.
145
So I'm replacing ice by Smaltz.
146
All right.
147
Good but then we will replace the names of these variables here.
148
We chose x y z w an H for the eyes.
149
Now since we're dealing with a mouse we're going to replace x by a sex e y y s y either will Y S W and
150
H by s h.
151
That's safer.
152
OK.
153
And then therefore for each Smout detector we are going to draw the rectangle around this mouse.
154
So we do that still in the region of interest.
155
This time the colored region of interest because we want to have the original footage with the colors.
156
Then of course we need to replace the X and e y by x x and x y and same here X plus E.W. is replaced
157
by as 6 plus s w and E.W. PCH we replaced by S-W plus S H.
158
Perfect.
159
And now let's choose a different color for this mouse.
160
So let's see we have 2 5 5 0 0 0 2 5 5 and 0 and so now that shows 0 0 and 2.5 that will give us a different
161
color.
162
Perfect We will have three different colors to detect the face that will be in blue.
163
Then the eyes in green and now the smell will be detected in red.
164
Perfect.
165
All right so that's it that's actually done for phase 2 we implemented the code to detect a smile.
166
So now let's have a look at the results.
167
I'm going to execute this code and let's see if it manages to detect correctly some smells.
168
So I'm going to select everything here and press command control plus enter to execute.
169
There we go.
170
Here I am.
171
Hello again happy to see you again and congratulations by the way for those of you who reached this
172
step with all the red rectangles in your face.
173
Don't worry about this.
174
This is not our final answer.
175
We will improve this.
176
Of course we don't have a good smell detector here so we have to do something to improve this indeed.
177
So the face is correct correctly detected that either correctly detected but we see some red rectangles
178
all around my face.
179
That's not good.
180
So according to you what do we have to do.
181
Well the answer is to choose some different parameters some different parameters in our detect ask methods.
182
So that's exactly what we're going to do.
183
And in the end we should have only one red rectangle around my ear around my mouth and only when I'm
184
smiling of course we're making smell detector.
185
So let's do this.
186
I'm going to press Q to quit.
187
I just quit.
188
And now let's proceed to phase four because phase 3 was about watching the result.
189
Let's proceed to face forward to improve the code.
190
So as I said we have to change the parameters and the detect multitasking method.
191
All right.
192
So let's look at them one by one.
193
The first one is air or gray which is a region where we apply the detection according to you.
194
Do we need to change that.
195
Well not really.
196
We're not going to replace it by Gray because then we will see some red rectangles all around my place.
197
You know if I have any shape of object in my place that look like a man will see a red rectangle around
198
it.
199
That will be that good.
200
And believe it or not that will be even worse than what we just got.
201
So no we keep our eye Crais because we want to make the detection and the referential of the face for
202
the simple reason that a smile is in the face.
203
Then second parameter 1.1 during what this is about.
204
This is about the scaling factor.
205
And in fact we're going to replace it by a new number.
206
We're going to choose a larger scaling factor and we're going to increase it to 1.7.
207
All right.
208
This is not what will help the most improve the solution but still it will help a little but the parameter
209
that will definitely make a difference is the number of neighbors we really want to increase the number
210
of neighbors because in some way that the direction has to be much more thorough.
211
If we have a low number of minimal neighbors well anything that looks approximately like a smell will
212
be detected as a smell and that will be not good.
213
And that's why we obtained many rectangles in the previous detection.
214
So we're going to considerably increase this minimum number of neighbors.
215
Now the right number is obtained with experimentation.
216
That's another thing very common when doing some computer vision or machine learning or you always have
217
to experiment.
218
Well this actually goes with research.
219
But here we have to replace this number.
220
And I'm going to give you the right number now.
221
I mean the a number that works very well.
222
That will get us a new one rectangle detecting when I'm smiling when you're smiling.
223
And this number is 22.
224
We increased the number of minimum neighbors from 3 to 22 and that's all we need to do to improve this
225
computer vision solution.
226
And now let's look at the results.
227
I'm going to execute that again.
228
There we go.
229
Executed.
230
Now let's see.
231
All right.
232
So hello again.
233
Well now as you can see I'm not smelling I'm neutral and nothing happens.
234
What does happen when I smile.
235
There we go.
236
We can see a red rectangle detecting detecting when I'm smelling.
237
I'm sorry for the non natural smell but I'm trying to make this work all right here it works very well.
238
We can we can try to still improve this.
239
So I'm going to press Q And I'm even going to increase the minimum number of neighbors of the eyes and
240
I'm also going to remove my mike because I think it's interfering with the detection.
241
So let's see.
242
I'm going to increase the minimum number of neighbors of the eyes to also 22 and we'll see what happens.
243
So there we go.
244
Now we have for the eye a scaling factor of 1.1 and 22 minimum neighbors.
245
And for this now we have a scaling factor of 1.7 and 22 minimum neighbors.
246
Now I'm going to put my mike a little bit away from me but not the force that you can still hear me.
247
I'm going to say like that again.
248
Execute.
249
And now let's see what happens.
250
And here are the results.
251
OK.
252
So first of all we see that the eye detection works much better.
253
I'm trying not to smile so we can indeed see two red red to green rectangles around the eyes and not
254
any around my nose as we could observe before.
255
And right now I'm having a neutral smell and not smelling.
256
And what does happen when I smell
257
we see the red rectangle.
258
Cool.
259
And now what has happened when I don't smile.
260
Know smile it's not
261
smile no smile now no smile.
262
Ok it seems to be working very well.
263
I work much better than before.
264
I'm glad we proved this and the smile is really working well.
265
Not only we see only one rectangle when I'm smiling but also it only appears when I smell.
266
All right perfect so that's done for the homework.
267
Congratulations if you reached that phase.
268
That is if you manage to make this mounded takes you by changing the parameters to make it work.
269
That was not an easy homework we had several things to do several phases to go through.
270
But if you managed to get this no phase detector detector and smell detector well really congratulations.
271
And again for those of you who didn't obtain this but still try it and spend some time trying to get
272
a good smell detector.
273
Well congratulations to you to be relieved.
274
That also made you progress definitely.
275
So now it's actually the end of Mudgal one face recognition.
276
I was very happy to do this for us Mudgal with you.
277
Now we're going to take things at the next level with object detection.
278
We're going to build a state of the art computer vision more all that beats any other model for object
279
detection.
280
It's as is the model single shot multi-book detection.
281
So I look forward to starting Munjal too with you.
282
And until then enjoy computer vision.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.