File size: 12,183 Bytes
e62bc71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | 1
00:00:00,700 --> 00:00:01,040
OK.
2
00:00:01,050 --> 00:00:03,310
So welcome to twenty one point three.
3
00:00:03,510 --> 00:00:09,060
Well actually talk about and tell you how to go about creating a custom tensor for up to detection module
4
00:00:09,260 --> 00:00:10,220
model.
5
00:00:10,890 --> 00:00:17,490
So training the tens of the action the training process of tensile flow of detection is honestly a bit
6
00:00:17,490 --> 00:00:23,970
messy and this is probably one of the best of the detection Well most mature object libraries on the
7
00:00:23,970 --> 00:00:25,600
market today market.
8
00:00:25,640 --> 00:00:33,540
But an open source market you can say and it's explained fairly well it actually is bit tricky to use.
9
00:00:34,020 --> 00:00:36,530
So this is a step I broke down from looking at it.
10
00:00:36,570 --> 00:00:40,310
So first we prepare a data set in the T.F. record format.
11
00:00:40,380 --> 00:00:41,440
That's a specific record.
12
00:00:41,460 --> 00:00:43,500
I'll show you in the next few slides.
13
00:00:43,950 --> 00:00:48,570
Then we need to create a class label file that's a dog P.B. text file.
14
00:00:48,570 --> 00:00:53,760
Then we need to download a pre-trained Kokoo model and we need to set up the correct file that actually
15
00:00:53,760 --> 00:00:58,490
structure configured the object action pipeline and then start training.
16
00:00:58,500 --> 00:01:00,690
So let's go step by step.
17
00:01:00,720 --> 00:01:03,220
So what does it T.F. record format.
18
00:01:03,270 --> 00:01:07,650
So it tends to flow because the action expects so it treating and test data to be in this T.F. or the
19
00:01:07,650 --> 00:01:09,220
school record format.
20
00:01:09,300 --> 00:01:11,460
This is pretty much what it looks like here.
21
00:01:11,910 --> 00:01:17,220
Luckily though we can convert existing data sets that's like in the past SQL View see data set which
22
00:01:17,220 --> 00:01:22,260
is stored in Exod. Mosha directly to ATF records file by using the script.
23
00:01:22,290 --> 00:01:24,300
They provide this for the here.
24
00:01:24,690 --> 00:01:26,790
So it's quite myself.
25
00:01:27,510 --> 00:01:30,030
And no we talk about a classily files.
26
00:01:30,030 --> 00:01:32,910
So basically this is what the castable file looks like.
27
00:01:33,850 --> 00:01:41,350
It's basically just on a dictionary Shukria where we have the IDs and label names.
28
00:01:41,350 --> 00:01:44,660
So that's pretty much what we need to do with redefining.
29
00:01:44,830 --> 00:01:50,560
If we're training a detector to detect let's say London underground tube signs you'll just put the name
30
00:01:50,560 --> 00:01:56,740
of the class here and it's I.D. and you keep adding more and more items all objects here.
31
00:02:00,660 --> 00:02:03,510
So now we have to use pre-trained model.
32
00:02:03,840 --> 00:02:04,250
OK.
33
00:02:04,380 --> 00:02:11,860
So we don't train this model and this is like the resonant model that we use in the previous chapter.
34
00:02:12,240 --> 00:02:13,890
So we don't have one here.
35
00:02:13,920 --> 00:02:20,490
So tensile flow who has several pre-treat models and one Ko-Ko and Coko is basically a large scale object
36
00:02:20,490 --> 00:02:26,020
protection segmentation and captioning data set and basically has a lot of features here.
37
00:02:26,370 --> 00:02:31,320
You can go to the Web site this Cocco decision it and you will find it.
38
00:02:31,900 --> 00:02:33,950
And so you don't live with the models here.
39
00:02:34,230 --> 00:02:38,620
This link carries you to all the models that are available on tensor.
40
00:02:39,030 --> 00:02:44,560
And basically just use it downloaded onto mental health and on target here.
41
00:02:44,730 --> 00:02:46,470
So that's what we do.
42
00:02:47,100 --> 00:02:50,180
And this is a list of all the models of healable here.
43
00:02:50,280 --> 00:02:55,620
It gives the speed and the map scope which is quite useful helps you choose which model is most appropriate
44
00:02:55,620 --> 00:02:56,590
for your application.
45
00:02:58,530 --> 00:03:05,310
So now we get to configure object detection pipeline said abjection pipeline configuration file is composed
46
00:03:05,310 --> 00:03:07,780
of five sections.
47
00:03:07,800 --> 00:03:12,610
Basically we have a model that we define here to configuration here.
48
00:03:13,110 --> 00:03:15,310
Then we have the training config here.
49
00:03:15,480 --> 00:03:23,350
So we add this through here and the in part Real talk about soon the valuation config and evaluation
50
00:03:23,370 --> 00:03:24,090
in podrida.
51
00:03:24,090 --> 00:03:26,760
So let's take a look at this file in more detail.
52
00:03:26,790 --> 00:03:31,400
So this is a sample of the model file the model section here.
53
00:03:31,890 --> 00:03:34,900
What it looks like is this is the model config.
54
00:03:35,130 --> 00:03:35,720
I should say.
55
00:03:35,820 --> 00:03:36,340
OK.
56
00:03:36,690 --> 00:03:42,330
So we basically what we have to note is that we have some templates already that we can use inside of
57
00:03:42,470 --> 00:03:43,240
of flow.
58
00:03:43,530 --> 00:03:49,530
So we just basically make sure that all classes match up to the classes that enable custom are being
59
00:03:49,530 --> 00:03:50,910
attacked to Dexter.
60
00:03:51,420 --> 00:03:53,850
So this one was taken from the president one on one.
61
00:03:54,480 --> 00:03:56,940
And those Treen in the Pascrell VRC dataset.
62
00:03:57,330 --> 00:04:01,950
So as I said you don't need to rewrite this file just edit to one belonging to the preacher and model
63
00:04:02,070 --> 00:04:06,750
to be using Dymo defines the model defines all unnecessary.
64
00:04:06,850 --> 00:04:15,300
Our Or our CNN and as the parameters and when using pretreated models as best we leave this configuration
65
00:04:15,360 --> 00:04:19,170
configuration file unchanged unchanged just a bit.
66
00:04:19,170 --> 00:04:26,320
This red box here with the classes and notices that trade input Greedo and the yvel config and involved
67
00:04:26,360 --> 00:04:27,900
in podrida sections.
68
00:04:27,900 --> 00:04:31,990
So this is what we have to try and change these in red.
69
00:04:32,070 --> 00:04:33,840
Basically directory mappings.
70
00:04:33,840 --> 00:04:38,010
So we have to make sure that they're actually correct and pointing to the correct files that you want
71
00:04:38,010 --> 00:04:38,780
to use.
72
00:04:38,820 --> 00:04:40,740
This will be your label file.
73
00:04:40,800 --> 00:04:44,440
This will be your record file you're treating UTF record file.
74
00:04:44,670 --> 00:04:46,270
This is what disappoints do here.
75
00:04:46,500 --> 00:04:50,930
So for validation and for record for training and for validation.
76
00:04:51,510 --> 00:04:53,990
And this is Leavell parts of boat as well.
77
00:04:54,110 --> 00:04:54,680
OK.
78
00:04:54,910 --> 00:04:59,450
So remember the labels are the same ideas will be the same it's the same file.
79
00:04:59,890 --> 00:05:00,350
OK.
80
00:05:04,360 --> 00:05:06,870
So now here's the directory structure of the project.
81
00:05:06,910 --> 00:05:09,560
So this is how and where we put our files.
82
00:05:09,850 --> 00:05:14,860
So the PBX ex-felon label file that goes inside a directory called data.
83
00:05:15,250 --> 00:05:22,270
Then we have a record files which is a train and evaluation of record files or validation whatever you
84
00:05:22,270 --> 00:05:24,230
want to call it same thing.
85
00:05:24,640 --> 00:05:29,820
And then we have a new directory here models and then we have subdirectory model here.
86
00:05:30,160 --> 00:05:32,360
This is where we put our pipeline config file.
87
00:05:32,500 --> 00:05:33,990
That's this file here.
88
00:05:34,390 --> 00:05:40,330
And then we just have the trained directory and the evaluation directory here as well under the model
89
00:05:40,660 --> 00:05:46,340
inside the model form which is inside of the models for the here.
90
00:05:46,350 --> 00:05:48,820
So now this is how we start the training process.
91
00:05:48,890 --> 00:05:56,810
So we go to basically terminal and we just copy this line of code here and make sure to code the lines
92
00:05:56,810 --> 00:05:57,970
in a read here.
93
00:05:58,280 --> 00:06:03,090
These correspond to the model you are using and the directory that we just created here.
94
00:06:03,260 --> 00:06:03,710
OK.
95
00:06:03,890 --> 00:06:10,010
This is the day that actually it needs to be pointing to and it doesn't do that.
96
00:06:10,010 --> 00:06:16,200
And then you can actually bring up tents board to monitor your treating progress which is pretty cool.
97
00:06:16,700 --> 00:06:18,770
It's going to be district directory here.
98
00:06:19,030 --> 00:06:22,230
That again does your data directly at the specified here.
99
00:06:25,340 --> 00:06:30,590
And then before that I should have mentioned this earlier but it's important when you're labeling it
100
00:06:30,590 --> 00:06:35,450
images use a software that actually produces it in the correct format.
101
00:06:35,450 --> 00:06:38,120
So this is how we use annotations here.
102
00:06:38,150 --> 00:06:43,710
So this is my wife with my dog Samuel and software we use as a label.
103
00:06:43,800 --> 00:06:50,190
AMG I think this is two elves they have here this really label I am the label image obviously.
104
00:06:50,540 --> 00:06:52,200
So download it if you want to do it.
105
00:06:52,220 --> 00:06:55,910
It's available for Windows Mac and Linux.
106
00:06:55,910 --> 00:07:01,690
And this is the format that Pascal VRC Exham a format that we use now.
107
00:07:01,820 --> 00:07:09,380
It is not what we used us but we generate the image anti-Chavez in this format using the software.
108
00:07:09,410 --> 00:07:11,160
It actually does it automatically for you.
109
00:07:11,630 --> 00:07:17,420
And we can use our tents for a script I mentioned earlier to convert this file directly back to the
110
00:07:17,420 --> 00:07:20,170
text of the record files.
111
00:07:20,270 --> 00:07:21,910
So this is a summary here.
112
00:07:22,010 --> 00:07:24,890
We didn't do a full project here for the following reasons.
113
00:07:25,160 --> 00:07:30,390
Training and SSTO even a faster are CNN One is you is very impractical.
114
00:07:30,440 --> 00:07:31,630
It is going to take forever.
115
00:07:31,700 --> 00:07:38,840
So you definitely need a GP or a cloud to use to effectively train this A.F. all the data sets are there
116
00:07:38,870 --> 00:07:46,190
huge there are quite a few gigs of storage and also to setting up a GPU when a local system is a nightmare
117
00:07:46,190 --> 00:07:46,790
sometimes.
118
00:07:46,880 --> 00:07:53,660
It's a very scary task but once you get it working it's good you feel very happy because it's so much
119
00:07:53,660 --> 00:07:54,950
faster.
120
00:07:55,620 --> 00:07:58,150
So I've of all time general steps here.
121
00:07:58,220 --> 00:08:05,040
The Trina's model there are also some good tutorials I found online that do this as well.
122
00:08:05,090 --> 00:08:10,430
Basically try to make it as simple as possible if you going through all the steps telling you what to
123
00:08:10,430 --> 00:08:13,210
pay attention to and what's important.
124
00:08:13,220 --> 00:08:16,880
I've actually tried this on my system as well so I know what works.
125
00:08:16,910 --> 00:08:23,150
So I wish you all the best of luck when making your own object to actual text detectors.
126
00:08:23,300 --> 00:08:23,610
Thank you.
|