Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
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 this patented Hoyo today we're going to create the SSD neural network.
2
So we already defined our detect function.
3
So now the main thing that we have to do left is to indeed create this as is the neural network.
4
But the good news is that we already have the weights of a pre-trained as is the neural network.
5
So what will simply do is create an object that will represent the neural network itself.
6
Thanks to the build SSD the function that we import from this SSD pipe and fallar recommend to have
7
a look at this.
8
And then after we create this neural network object we will get the weights by loading from an already
9
pre-trained as is the neural network.
10
The weights are contained in this file.
11
We're going to get these weights by using torture load which is a function of torch and that will open
12
a tensor that will contain these weights and then using another function to load state dict function.
13
We will attribute these loaded weights to our instance object of our neural network.
14
So that's exactly the process.
15
It's not that hard.
16
We will do it in three or four lines of code.
17
So let's do this.
18
The first thing that we need to do is to create our neural network object.
19
So we're going to call this new one that work not just to align with this variable here but we could
20
actually choose another name it's just less confusing this way.
21
And now as we just said we're going to use to build as is the function that is a function from the SSD
22
pattern file.
23
So we call this function build underscore SSD.
24
And in this function we actually have to input only one argument.
25
This argument is the face you have two possible phases.
26
The train phase and the test phase.
27
But here since we're going to use an already pre-trained model bellowing its weight well we're not going
28
to train anything.
29
We're just going to test actually because we're going to test as is the model on our Video of the funny
30
dog.
31
So the face we have to choose here is test and we just put it this way in quotes test just like that
32
and that's it.
33
Our neural network our SSD neural network is created with this single line of code.
34
Awesome.
35
Then next step as we said the next step is to load the weights of an already pre-trained SSD neural
36
network and the name of this already pre-trained neural network is exactly SSD 300 and this core map
37
underscores seventy seven point forty three underscore V-2 that's the name of the neural network.
38
That's a powerful one.
39
It was pre-trained to detect between 30 to 40 objects and you're going to see that on the video that
40
it's not only going to detect the drug.
41
It's going to detect more.
42
So actually this model and this will be part of the homework you will have to test this model on other
43
videos containing other objects.
44
So that's the best pre-trained model we could find.
45
And believe me or believe the paper is actually more powerful than some other great object detection
46
Morell's like faster or CNN or yellow.
47
According to the paper that is according to the cases tested by the paper the SSD is the most powerful.
48
A mom says the first of our CNN and yellow.
49
All right.
50
So let's slow this wait.
51
And to load these weights we just need to take our new network object and then we're going to use the
52
load underscore state underscored dict function and inside this function we exact input.
53
Well in quotes our pre-trained model says the 300 this core and a P underscore 77 dot 43 underscore
54
the two dot p t h.
55
But these weights we're going to put them into a tensor and therefore inside the load state dict function
56
I'm going to call another function which I already mentioned that is the torch that load function.
57
So the load function from the torture library and this towards stop load function will open a tensor
58
that will contain these weights and then the use of the load stated function is to attribute these weights
59
to our esset the neural network object.
60
All right so that's almost ready we just need to add two more arguments in our torch's upload function.
61
The first one is map underscore location and that should be equal to lambda storage and a third argument
62
luck for location storage.
63
All right so that's just the way to open a center that will contain these weights.
64
And so now not only do we have a sensor that contains these weights but also these weights or attribute
65
it to our as is the net object.
66
All right.
67
Now the neural network SSD single shot multi-post detection is created.
68
So that means that we have the frames coming from the video and we have our neural network nets but
69
remember to apply the detect function on the frames.
70
We not only need the frames and the net but we also need the transform transformation and that's exactly
71
what we're going to create in the next tutorial.
72
We're going to create this transformation that will make sure that the input frames coming from the
73
video and that will be the input of the function will be compatible with our SSD neural network.
74
So let's just create this last thing we need.
75
That is a transformation in the next tutorial.
76
And until then you can build a vision.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.