1
00:00:01,320 --> 00:00:03,480
Right to touch with our own image.

2
00:00:03,480 --> 00:00:07,010
We can go online and download some images.

3
00:00:07,050 --> 00:00:09,240
I'm just gonna download some cuts images

4
00:00:14,720 --> 00:00:19,040
I'm gonna go to Google dot com my computer.

5
00:00:19,440 --> 00:00:24,400
I don't know it's running a bit slow.

6
00:00:41,580 --> 00:00:42,110
Okay.

7
00:00:42,210 --> 00:00:43,320
We can download a few

8
00:00:46,920 --> 00:00:49,470
cannot right click this save this

9
00:00:53,050 --> 00:00:54,790
occur this empty one

10
00:00:58,840 --> 00:00:59,480
then.

11
00:00:59,550 --> 00:01:00,540
How about this one.

12
00:01:00,570 --> 00:01:05,560
Save this I empty too.

13
00:01:06,690 --> 00:01:07,750
Let's try this.

14
00:01:07,760 --> 00:01:11,590
Save this I empty three.

15
00:01:11,800 --> 00:01:13,780
How well we probably.

16
00:01:13,860 --> 00:01:14,360
Mix it up.

17
00:01:14,370 --> 00:01:17,160
I'm gonna search car image as well.

18
00:01:20,320 --> 00:01:27,290
NOBODY'S SAFE THIS I empty for a c

19
00:01:33,530 --> 00:01:34,180
c of us.

20
00:01:34,940 --> 00:01:38,580
I am G five K.

21
00:01:39,830 --> 00:01:41,140
Oh we try a bird.

22
00:01:41,230 --> 00:01:43,600
We got lost to image

23
00:01:54,830 --> 00:01:56,350
I empty six.

24
00:01:56,410 --> 00:02:01,720
Okay so let's take these images and put them in our images folder.

25
00:02:01,930 --> 00:02:02,980
Come here.

26
00:02:02,980 --> 00:02:08,520
Fetch these.

27
00:02:08,870 --> 00:02:10,640
This is my project forward.

28
00:02:10,690 --> 00:02:16,120
I've got an empty photo here called images right.

29
00:02:16,790 --> 00:02:24,780
So let's test the images and then I can close this.

30
00:02:25,370 --> 00:02:32,750
Okay so I'm gonna come down here and um I'm gonna see if this actually to create a new safe point.

31
00:02:32,840 --> 00:02:34,040
Call this number eight.

32
00:02:39,360 --> 00:02:49,530
And I'm gonna see um my image a cause and we can just take one of the images.

33
00:02:49,530 --> 00:02:56,400
Let's start with S. I MDG 1 the JPEG that S J peachy like this.

34
00:02:56,580 --> 00:03:08,220
And then the name of the file we know we can locate it in our images folder in the name of the image

35
00:03:08,400 --> 00:03:13,590
is my image name right.

36
00:03:13,630 --> 00:03:21,440
So once that is done we're gonna see it image a course and Pitot array and then we're gonna do.

37
00:03:21,480 --> 00:03:31,680
And the image that I am read then we pass the file name and the path and then flatten

38
00:03:35,110 --> 00:03:36,040
it course force

39
00:03:39,850 --> 00:03:43,960
once that is done we gonna see my image.

40
00:03:47,230 --> 00:03:55,280
Because Sy pi dot miscellaneous dot image resize

41
00:03:58,430 --> 00:03:59,740
we need to resize it first.

42
00:04:00,590 --> 00:04:12,320
What we're gonna do is post image here and then the size here is gonna be um the size of our standard

43
00:04:12,320 --> 00:04:18,860
image which is this the height and weight of the of the images that we use we're gonna use resize it

44
00:04:18,860 --> 00:04:22,700
to the size num underscore p x number of pixels.

45
00:04:23,240 --> 00:04:26,430
So I'm gonna pass this size over here.

46
00:04:28,570 --> 00:04:32,540
It's gonna be a number of pixels by a number of pixels and then

47
00:04:35,610 --> 00:04:38,490
I'm gonna see a dot reshape

48
00:04:42,830 --> 00:04:53,970
then I'm gonna pass one over here then the number of pixels times number of pixels transpose right.

49
00:04:55,520 --> 00:05:02,630
So this will give us the um the vector that we wanted a column vector which our neural network accepts.

50
00:05:02,720 --> 00:05:06,590
So I'm gonna say my um

51
00:05:10,730 --> 00:05:13,680
C AMG prediction.

52
00:05:14,980 --> 00:05:22,470
Because then I'll call it a predictive function and what I'm gonna do is take the weight by accessing

53
00:05:22,470 --> 00:05:31,340
our dictionary and passing w here to get a weight and then the bias as well.

54
00:05:31,500 --> 00:05:41,260
We find it in the same dictionary b over here and then the input is my image.

55
00:05:41,420 --> 00:05:47,400
Here we can show the predicted image we can show the um the image by saying BLT.

56
00:05:47,430 --> 00:05:49,490
I m show.

57
00:05:50,030 --> 00:05:59,910
And then um we simply pass image we post this here and then we can print the result as well and um we

58
00:05:59,910 --> 00:06:06,740
can simply do print.

59
00:06:07,590 --> 00:06:14,070
The prediction is an SDR.

60
00:06:14,300 --> 00:06:21,300
I'm gonna squeeze the dimension by doing MP dot squeeze and I'll show you later on the difference between

61
00:06:21,300 --> 00:06:23,430
using squeeze and not using a squeeze.

62
00:06:23,430 --> 00:06:32,460
After we run this experiment and what I'm gonna pass us argument here is my empty prediction here.

63
00:06:32,490 --> 00:06:33,210
Right.

64
00:06:33,650 --> 00:06:37,310
So yeah this should give us the resort.

65
00:06:37,560 --> 00:06:39,770
I'm gonna do POTUS show over here

66
00:06:43,970 --> 00:06:51,130
okay so I've passed I am g 1 this is I am g 1.

67
00:06:51,210 --> 00:06:54,290
Let's see what a neural network is gonna say.

68
00:06:54,510 --> 00:06:56,480
Gonna run over here run module

69
00:07:05,510 --> 00:07:06,080
okay.

70
00:07:06,140 --> 00:07:06,910
Creasy.

71
00:07:07,310 --> 00:07:09,520
Test like reach the 70.

72
00:07:09,680 --> 00:07:10,310
Close this

73
00:07:13,610 --> 00:07:14,700
I am Reed.

74
00:07:14,780 --> 00:07:15,940
We have an error.

75
00:07:15,950 --> 00:07:18,410
It says a..

76
00:07:18,440 --> 00:07:22,220
Image has no attribute.

77
00:07:22,220 --> 00:07:23,150
I m Reed.

78
00:07:23,900 --> 00:07:24,460
Okay.

79
00:07:24,490 --> 00:07:27,530
A C right.

80
00:07:27,620 --> 00:07:29,010
Um yeah.

81
00:07:29,090 --> 00:07:30,350
Let's inspect our code.

82
00:07:31,640 --> 00:07:33,500
Um what we did

83
00:07:37,070 --> 00:07:39,020
I read okay.

84
00:07:39,070 --> 00:07:44,180
We probably have a different version of PSI pi to have to reinstall the.

85
00:07:44,250 --> 00:07:48,340
So the decide package and then um.

86
00:07:48,370 --> 00:07:48,940
Oh [REMOVED] yeah.

87
00:07:48,940 --> 00:07:50,700
Also there's a mistake.

88
00:07:51,070 --> 00:07:56,430
Remember our image has three channels so we've gonna multiply by three over here.

89
00:07:56,830 --> 00:08:06,740
When we reshape it right we have to reshape it to the the column vector that our neural network accepts.

90
00:08:06,970 --> 00:08:07,360
Right.

91
00:08:07,420 --> 00:08:09,700
And we saw how to do this earlier.

92
00:08:10,690 --> 00:08:13,050
So we simply use in this hyper library to reshape it.

93
00:08:13,060 --> 00:08:16,240
But it seems this a library.

94
00:08:16,440 --> 00:08:19,270
No it's not it's not playing ball.

95
00:08:19,330 --> 00:08:19,630
Okay.

96
00:08:19,660 --> 00:08:20,680
Let's see whether it works.

97
00:08:20,680 --> 00:08:21,750
After fixing this.

98
00:08:21,790 --> 00:08:22,420
If it doesn't.

99
00:08:22,430 --> 00:08:29,760
Would have to revert to a different version of spy or click here to run the module.

100
00:08:37,650 --> 00:08:38,100
Okay.

101
00:08:42,910 --> 00:08:46,060
What does it say.

102
00:08:46,060 --> 00:08:47,770
Wait we have something near

103
00:08:54,940 --> 00:08:57,490
it says I am resize is deprecated.

104
00:08:58,060 --> 00:08:58,500
Okay.

105
00:08:58,570 --> 00:08:59,790
Wait.

106
00:08:59,800 --> 00:09:03,400
If you you're still in work then this is what we have to do.

107
00:09:03,510 --> 00:09:06,080
I'll show you perhaps some of you still have the arrow.

108
00:09:06,130 --> 00:09:11,440
You come to the installation folder where we install the python installer here you go to the script

109
00:09:11,600 --> 00:09:19,420
photo within the installation folder and then I'm going to hold on shift right click and then open come

110
00:09:19,420 --> 00:09:25,060
on window here and I'm going to on install side by or do Pip

111
00:09:28,360 --> 00:09:29,440
on install side by

112
00:09:32,310 --> 00:09:34,560
and then you would ask Do I want to continue.

113
00:09:34,610 --> 00:09:38,350
Say yes and then it says successfully on installed.

114
00:09:38,460 --> 00:09:45,910
Then I'm going to install Sai pi one point one cause those image root functions are from Sai Pi I think

115
00:09:45,910 --> 00:09:47,190
get deprecated now.

116
00:09:47,190 --> 00:09:51,480
That is why new installations might receive such an arrow.

117
00:09:51,480 --> 00:09:57,770
Later on we would um we would have to use the other library such as the p.

118
00:09:58,040 --> 00:10:05,760
Uh the python imaging library pill and perhaps not plot lib to reshape and read out what images we would

119
00:10:05,760 --> 00:10:06,530
have to do that later.

120
00:10:06,540 --> 00:10:08,290
But now we can use IPA.

121
00:10:08,490 --> 00:10:13,270
So I'm gonna do pip install pi.

122
00:10:13,830 --> 00:10:19,770
You cause one point one point zero like this then I'm going to hit enter.

123
00:10:21,660 --> 00:10:25,880
So he's gonna take a while to install the um the side pi.

124
00:10:26,310 --> 00:10:34,590
So if you receive an arrow about with regards to um image read then you would have to.

125
00:10:35,030 --> 00:10:39,030
You would have to reinstall CI pi it successfully installed.

126
00:10:39,220 --> 00:10:40,680
You just might take a longer time.

127
00:10:40,680 --> 00:10:41,240
It's fine.

128
00:10:41,760 --> 00:10:42,330
Okay.

129
00:10:42,330 --> 00:10:46,290
So once that is done verify that you have this here.

130
00:10:46,830 --> 00:10:48,060
I'm gonna click here to run

131
00:10:52,430 --> 00:10:53,080
it's learning

132
00:10:57,350 --> 00:10:57,720
Okay

133
00:11:00,660 --> 00:11:01,570
it's what we have.

134
00:11:02,110 --> 00:11:06,960
And this is somewhat image image number one and the prediction is zero

135
00:11:11,460 --> 00:11:12,600
this is strange.

136
00:11:12,600 --> 00:11:16,720
So it failed to predict this accurately.

137
00:11:16,890 --> 00:11:24,000
We have some warning here it says image resize is deprecated and will be removed at one point too.

138
00:11:24,000 --> 00:11:29,910
Okay so we can install we can use SDK major so we can use ASCII image for this next time.

139
00:11:30,300 --> 00:11:34,690
Okay but let's try our neural network once more.

140
00:11:35,220 --> 00:11:43,180
So the first prediction s supposed to be a cut but we the the resort we got was results for no cut.

141
00:11:43,260 --> 00:11:44,020
Let's try.

142
00:11:44,130 --> 00:11:44,820
Image 2

143
00:12:00,330 --> 00:12:02,120
prediction 0 again

144
00:12:08,580 --> 00:12:15,030
the prediction is you mean this also is not a cut I cut into the cut into the solution.

145
00:12:15,030 --> 00:12:16,510
Okay let's see.

146
00:12:16,540 --> 00:12:18,030
There has to be something wrong somewhere.

147
00:12:21,540 --> 00:12:23,310
So let's try image 3.

148
00:12:23,310 --> 00:12:25,870
This is a major three major three say Cut.

149
00:12:25,890 --> 00:12:29,080
Let's try that already tried this.

150
00:12:29,220 --> 00:12:32,670
Let's try it 3 and see what we get.

151
00:12:32,910 --> 00:12:37,170
Image number three when I run over here

152
00:12:47,420 --> 00:12:50,810
this is a cut and the prediction is 1 1 means.

153
00:12:50,810 --> 00:12:51,570
True.

154
00:12:51,590 --> 00:12:53,910
So this was predicted correctly.

155
00:12:54,560 --> 00:12:59,330
Okay let's see image number for this car.

156
00:12:59,450 --> 00:13:00,220
Let's see.

157
00:13:00,290 --> 00:13:02,630
I'm gonna select image number four over here

158
00:13:15,280 --> 00:13:15,750
okay.

159
00:13:23,300 --> 00:13:24,860
Image number four.

160
00:13:24,910 --> 00:13:26,140
Prediction is zero.

161
00:13:26,920 --> 00:13:30,760
And as we know image number four is not a car.

162
00:13:30,920 --> 00:13:32,400
Let's to image number three again.

163
00:13:32,530 --> 00:13:37,420
I realize that the resort was out of the window as I was reading it to you.

164
00:13:37,480 --> 00:13:49,290
So I'll come back to major number three and show you what that prediction said.

165
00:13:49,960 --> 00:13:50,470
OK.

166
00:13:50,470 --> 00:13:56,890
It says 1 but have to reshape this.

167
00:13:56,890 --> 00:13:58,380
So we have it over here.

168
00:13:58,380 --> 00:13:59,660
Prediction is one meaning.

169
00:13:59,690 --> 00:14:00,430
It's true.

170
00:14:00,450 --> 00:14:02,100
It's a cut right

171
00:14:04,960 --> 00:14:05,930
and then.

172
00:14:06,370 --> 00:14:09,190
Let's see the next images image number five.

173
00:14:09,190 --> 00:14:11,910
Let's see what the car is going to be confused.

174
00:14:11,900 --> 00:14:12,580
That's it cut

175
00:14:16,100 --> 00:14:17,250
when I run

176
00:14:25,910 --> 00:14:26,350
okay.

177
00:14:26,360 --> 00:14:27,500
Prediction is zero.

178
00:14:27,500 --> 00:14:31,700
Meaning it's not a cut and this is correct.

179
00:14:31,700 --> 00:14:34,300
Let's see the last one you made.

180
00:14:34,340 --> 00:14:36,320
Number six is the bird.

181
00:14:36,380 --> 00:14:38,470
Let's see what a prediction is going to be.

182
00:14:38,480 --> 00:14:54,650
What does going to be confused for a cut.

183
00:14:55,590 --> 00:14:55,890
Okay.

184
00:14:55,920 --> 00:14:56,870
This is zero.

185
00:14:56,880 --> 00:14:58,180
This is not a cut.

186
00:14:58,330 --> 00:15:01,330
So it seems our new network.

187
00:15:01,540 --> 00:15:13,620
This work and well it it performs better find in non cut then um then find an actual cut mean meaning

188
00:15:13,650 --> 00:15:19,620
if you show a picture that is not a cut it's definitely it works better by telling you this is not a

189
00:15:19,620 --> 00:15:20,260
cut.

190
00:15:20,380 --> 00:15:27,090
It s performance is better when the image is not a cut but when you have an actual cut it's performance

191
00:15:27,360 --> 00:15:28,870
sometimes is food.

192
00:15:28,950 --> 00:15:32,290
Sometimes you would see a cut and it wouldn't predict that it's an actual cut.

193
00:15:32,360 --> 00:15:37,710
And like I said this is not the best way to implement image recognition.

194
00:15:37,770 --> 00:15:39,570
This just experimental.

195
00:15:39,710 --> 00:15:41,090
We would see a better fit.

196
00:15:41,160 --> 00:15:49,020
We would see um we would have two versions two new versions of the same implementation detecting cuts

197
00:15:49,170 --> 00:15:50,540
versus not cuts.

198
00:15:50,700 --> 00:15:53,120
We would go and use a deep new network to do it.

199
00:15:53,130 --> 00:15:56,160
And then after that we'll try convolution on your network.

200
00:15:56,160 --> 00:16:04,020
But I would advise that you try this out and then gets more cuts images and try it out and also play

201
00:16:04,020 --> 00:16:11,750
with the um the lending rate as well as the number of iterations to see if its performance can improve

202
00:16:12,270 --> 00:16:17,490
and you can throw some other images of known cuts and see if you can get it to confuse something that

203
00:16:17,490 --> 00:16:18,980
is in a cut for a cut.

204
00:16:18,990 --> 00:16:22,310
So far we've not seen it but when we've seen it it won't.

205
00:16:22,320 --> 00:16:23,580
We have seen so far.

206
00:16:23,610 --> 00:16:29,170
Sometimes you give a cut and it says it's not a cut but we've not seen it tell you.

207
00:16:29,190 --> 00:16:31,680
This is a cut when it's not a cut.

208
00:16:31,800 --> 00:16:38,100
What I mean is we've not seen the neural network confuse a known cut for a cut but we've seen it confuse

209
00:16:38,220 --> 00:16:39,940
a cut for a known cut.

210
00:16:39,940 --> 00:16:45,240
So yeah you should experiment with it more but yeah this or the rest for this lesson if you have any

211
00:16:45,240 --> 00:16:48,450
questions just send me a message if anything at all.

212
00:16:48,450 --> 00:16:54,150
If you have suggestions or you know you just want to run TiVo or something then or you just want to

213
00:16:54,150 --> 00:16:58,590
say something which regards the course you can message me and I'll see you later.

214
00:16:58,590 --> 00:16:59,190
Have a nice day.
