├── LICENCE ├── README.md ├── detect_one.py ├── images ├── dog-cycle-car.png ├── person-dog-horse.jpg └── person-dog.jpg ├── interp.py ├── model ├── coco.names └── yolov3.prototxt └── utils.py /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Qianhao Zhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YOLOv3-caffe 2 | 3 | usage: 4 | 5 | python detect_one.py --image=images/dog-cycle-car.png 6 | 7 | ### Acknowledgements 8 | 9 | The major part is adapted from [Ayoosh Kathuria](https://github.com/ayooshkathuria)'s 10 | 11 | amazing tutorial on YOLOv3 implementation in pytorch. 12 | 13 | The weight files can be downloaded from [YOLOv3-caffe](https://download.csdn.net/download/jason_ranger/10452595). 14 | (ignore the prototxt file with interp layer, explanation below) 15 | 16 | I also made a version where batchnorm computation is merged into convolution. The model can be downloaded from [YOLOv3-caffe-mergebn](https://download.csdn.net/download/jason_ranger/10519464) 17 | 18 | For people outside China, you can download from googledrive [YOLOv3-caffe](https://drive.google.com/open?id=1xR_y_gmBIWjrENgjXXzB4_5aSqYPeWnM) 19 | 20 | ### Notes 21 | 22 | A simplest YOLOv3 model in caffe for python3. 23 | 24 | This is merely a practice project. Note that I implemented an interp layer in python for compatibility. 25 | 26 | This is because interp layer is only viable in deeplab caffe, not in the official one. 27 | 28 | Moreover, the behavior of interp layer in deeplab is different from torch.nn.UpsamplingBilinear2d, 29 | 30 | in a sense that pytorch rescales (3,13,13) to (3,26,26) with a factor of 2, but deeplab caffe 31 | 32 | rescales it to (3,25,25) with the same factor. This causes weird performance degradation. 33 | 34 | To make the model dependent on C only, you need to customize the interp layer. 35 | 36 | In deeplab version, note in interp_layer.cpp, you need to fix the logic (take an example): 37 | 38 | `height_out_ = height_in_eff_ + (height_in_eff_ - 1) * (zoom_factor - 1)` 39 | 40 | into 41 | 42 | `height_out_ = height_in_eff_ * zoom_factor` 43 | 44 | -------------------------------------------------------------------------------- /detect_one.py: -------------------------------------------------------------------------------- 1 | import caffe 2 | import cv2 3 | from utils import * 4 | import argparse 5 | 6 | def parse_args(): 7 | parser = argparse.ArgumentParser('YOLOv3') 8 | 9 | parser.add_argument('--prototxt', type=str, default='model/yolov3.prototxt') 10 | parser.add_argument('--caffemodel', type=str, default='model/yolov3.caffemodel') 11 | parser.add_argument('--classfile', type=str, default='model/coco.names') 12 | parser.add_argument('--image', type=str, default='images/dog-cycle-car.png') 13 | parser.add_argument('--resolution', type=int, default=416) 14 | 15 | return parser.parse_args() 16 | 17 | def main(): 18 | args = parse_args() 19 | 20 | model = caffe.Net(args.prototxt, args.caffemodel, caffe.TEST) 21 | 22 | img_ori = cv2.imread(args.image) 23 | inp_dim = args.resolution, args.resolution 24 | img = img_prepare(img_ori, inp_dim) 25 | 26 | #cv2.imshow("?", img.transpose([1,2,0])) 27 | #cv2.waitKey() 28 | model.blobs['data'].data[:] = img 29 | output = model.forward() 30 | 31 | rects = rects_prepare(output) 32 | mapping = get_classname_mapping(args.classfile) 33 | 34 | scaling_factor = min(1, args.resolution / img_ori.shape[1]) 35 | for pt1, pt2, cls, prob in rects: 36 | pt1[0] -= (args.resolution - scaling_factor*img_ori.shape[1])/2 37 | pt2[0] -= (args.resolution - scaling_factor*img_ori.shape[1])/2 38 | pt1[1] -= (args.resolution - scaling_factor*img_ori.shape[0])/2 39 | pt2[1] -= (args.resolution - scaling_factor*img_ori.shape[0])/2 40 | 41 | pt1[0] = np.clip(int(pt1[0] / scaling_factor), a_min=0, a_max=img_ori.shape[1]) 42 | pt2[0] = np.clip(int(pt2[0] / scaling_factor), a_min=0, a_max=img_ori.shape[1]) 43 | pt1[1] = np.clip(int(pt1[1] / scaling_factor), a_min=0, a_max=img_ori.shape[1]) 44 | pt2[1] = np.clip(int(pt2[1] / scaling_factor), a_min=0, a_max=img_ori.shape[1]) 45 | 46 | label = "{}:{:.2f}".format(mapping[cls], prob) 47 | color = tuple(map(int, np.uint8(np.random.uniform(0, 255, 3)))) 48 | 49 | cv2.rectangle(img_ori, tuple(pt1), tuple(pt2), color, 1) 50 | t_size = cv2.getTextSize(label, cv2.FONT_HERSHEY_PLAIN, 1 , 1)[0] 51 | pt2 = pt1[0] + t_size[0] + 3, pt1[1] + t_size[1] + 4 52 | cv2.rectangle(img_ori, tuple(pt1), tuple(pt2), color, -1) 53 | cv2.putText(img_ori, label, (pt1[0], t_size[1] + 4 + pt1[1]), cv2.FONT_HERSHEY_PLAIN, 54 | cv2.FONT_HERSHEY_PLAIN, 1, 1, 2) 55 | cv2.imshow(args.image, img_ori) 56 | cv2.waitKey() 57 | 58 | 59 | if __name__ == '__main__': 60 | main() 61 | -------------------------------------------------------------------------------- /images/dog-cycle-car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonlovescoding/YOLOv3-caffe/5cc76835a0dccc1dd10191940fdf485d8be73f4c/images/dog-cycle-car.png -------------------------------------------------------------------------------- /images/person-dog-horse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonlovescoding/YOLOv3-caffe/5cc76835a0dccc1dd10191940fdf485d8be73f4c/images/person-dog-horse.jpg -------------------------------------------------------------------------------- /images/person-dog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonlovescoding/YOLOv3-caffe/5cc76835a0dccc1dd10191940fdf485d8be73f4c/images/person-dog.jpg -------------------------------------------------------------------------------- /interp.py: -------------------------------------------------------------------------------- 1 | import caffe 2 | import cv2 3 | 4 | class UpsamplingBilinear2d(caffe.Layer): 5 | 6 | def setup(self, bottom, top): 7 | params = eval(self.param_str) 8 | zoom_factor = params['zoom_factor'] 9 | 10 | # reshape is once-for-all 11 | n_out = int(bottom[0].num) 12 | self.w_out = int(bottom[0].width * zoom_factor) 13 | self.h_out = int(bottom[0].height * zoom_factor) 14 | c_out = int(bottom[0].channels) 15 | top[0].reshape(n_out, c_out, self.w_out, self.h_out) 16 | 17 | def reshape(self, bottom, top): 18 | pass 19 | 20 | def forward(self, bottom, top): 21 | for n in range(top[0].data[...].shape[0]): 22 | data = bottom[0].data[n, :, :, :] 23 | data = data.transpose((1, 2, 0)) 24 | data = cv2.resize(data, (self.w_out, self.h_out), interpolation=cv2.INTER_NEAREST) 25 | top[0].data[n, :, :, :] = data.transpose((2, 0, 1)) 26 | 27 | def backward(self, top, propagate_down, bottom): 28 | pass -------------------------------------------------------------------------------- /model/coco.names: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorbike 5 | aeroplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | sofa 59 | pottedplant 60 | bed 61 | diningtable 62 | toilet 63 | tvmonitor 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /model/yolov3.prototxt: -------------------------------------------------------------------------------- 1 | input: "data" 2 | input_shape { 3 | dim: 1 4 | dim: 3 5 | dim: 416 6 | dim: 416 7 | } 8 | layer { 9 | name: "Convolution0" 10 | type: "Convolution" 11 | bottom: "data" 12 | top: "369" 13 | convolution_param { 14 | num_output: 32 15 | bias_term: false 16 | group: 1 17 | pad_h: 1 18 | pad_w: 1 19 | kernel_h: 3 20 | kernel_w: 3 21 | stride_h: 1 22 | stride_w: 1 23 | 24 | 25 | } 26 | } 27 | layer { 28 | name: "BatchNorm1" 29 | type: "BatchNorm" 30 | bottom: "369" 31 | top: "BatchNorm1" 32 | batch_norm_param { 33 | use_global_stats: true 34 | moving_average_fraction: 0.9 35 | eps: 10e-06 36 | } 37 | } 38 | layer { 39 | name: "Scale1" 40 | type: "Scale" 41 | bottom: "BatchNorm1" 42 | top: "371" 43 | scale_param { 44 | bias_term: true 45 | } 46 | } 47 | layer { 48 | name: "ReLU2" 49 | type: "ReLU" 50 | bottom: "371" 51 | top: "372" 52 | relu_param { 53 | negative_slope: 0.1 54 | } 55 | } 56 | layer { 57 | name: "Convolution3" 58 | type: "Convolution" 59 | bottom: "372" 60 | top: "374" 61 | convolution_param { 62 | num_output: 64 63 | bias_term: false 64 | group: 1 65 | pad_h: 1 66 | pad_w: 1 67 | kernel_h: 3 68 | kernel_w: 3 69 | stride_h: 2 70 | stride_w: 2 71 | 72 | 73 | } 74 | } 75 | layer { 76 | name: "BatchNorm4" 77 | type: "BatchNorm" 78 | bottom: "374" 79 | top: "BatchNorm4" 80 | batch_norm_param { 81 | use_global_stats: true 82 | moving_average_fraction: 0.9 83 | eps: 10e-06 84 | } 85 | } 86 | layer { 87 | name: "Scale4" 88 | type: "Scale" 89 | bottom: "BatchNorm4" 90 | top: "376" 91 | scale_param { 92 | bias_term: true 93 | } 94 | } 95 | layer { 96 | name: "ReLU5" 97 | type: "ReLU" 98 | bottom: "376" 99 | top: "377" 100 | relu_param { 101 | negative_slope: 0.1 102 | } 103 | } 104 | layer { 105 | name: "Convolution6" 106 | type: "Convolution" 107 | bottom: "377" 108 | top: "379" 109 | convolution_param { 110 | num_output: 32 111 | bias_term: false 112 | group: 1 113 | pad_h: 0 114 | pad_w: 0 115 | kernel_h: 1 116 | kernel_w: 1 117 | stride_h: 1 118 | stride_w: 1 119 | 120 | 121 | } 122 | } 123 | layer { 124 | name: "BatchNorm7" 125 | type: "BatchNorm" 126 | bottom: "379" 127 | top: "BatchNorm7" 128 | batch_norm_param { 129 | use_global_stats: true 130 | moving_average_fraction: 0.9 131 | eps: 10e-06 132 | } 133 | } 134 | layer { 135 | name: "Scale7" 136 | type: "Scale" 137 | bottom: "BatchNorm7" 138 | top: "381" 139 | scale_param { 140 | bias_term: true 141 | } 142 | } 143 | layer { 144 | name: "ReLU8" 145 | type: "ReLU" 146 | bottom: "381" 147 | top: "382" 148 | relu_param { 149 | negative_slope: 0.1 150 | } 151 | } 152 | layer { 153 | name: "Convolution9" 154 | type: "Convolution" 155 | bottom: "382" 156 | top: "384" 157 | convolution_param { 158 | num_output: 64 159 | bias_term: false 160 | group: 1 161 | pad_h: 1 162 | pad_w: 1 163 | kernel_h: 3 164 | kernel_w: 3 165 | stride_h: 1 166 | stride_w: 1 167 | 168 | 169 | } 170 | } 171 | layer { 172 | name: "BatchNorm10" 173 | type: "BatchNorm" 174 | bottom: "384" 175 | top: "BatchNorm10" 176 | batch_norm_param { 177 | use_global_stats: true 178 | moving_average_fraction: 0.9 179 | eps: 10e-06 180 | } 181 | } 182 | layer { 183 | name: "Scale10" 184 | type: "Scale" 185 | bottom: "BatchNorm10" 186 | top: "386" 187 | scale_param { 188 | bias_term: true 189 | } 190 | } 191 | layer { 192 | name: "ReLU11" 193 | type: "ReLU" 194 | bottom: "386" 195 | top: "387" 196 | relu_param { 197 | negative_slope: 0.1 198 | } 199 | } 200 | layer { 201 | name: "Eltwise12" 202 | type: "Eltwise" 203 | bottom: "387" 204 | bottom: "377" 205 | top: "388" 206 | eltwise_param { 207 | operation: SUM 208 | coeff: 1 209 | coeff: 1 210 | } 211 | } 212 | layer { 213 | name: "Convolution13" 214 | type: "Convolution" 215 | bottom: "388" 216 | top: "390" 217 | convolution_param { 218 | num_output: 128 219 | bias_term: false 220 | group: 1 221 | pad_h: 1 222 | pad_w: 1 223 | kernel_h: 3 224 | kernel_w: 3 225 | stride_h: 2 226 | stride_w: 2 227 | 228 | 229 | } 230 | } 231 | layer { 232 | name: "BatchNorm14" 233 | type: "BatchNorm" 234 | bottom: "390" 235 | top: "BatchNorm14" 236 | batch_norm_param { 237 | use_global_stats: true 238 | moving_average_fraction: 0.9 239 | eps: 10e-06 240 | } 241 | } 242 | layer { 243 | name: "Scale14" 244 | type: "Scale" 245 | bottom: "BatchNorm14" 246 | top: "392" 247 | scale_param { 248 | bias_term: true 249 | } 250 | } 251 | layer { 252 | name: "ReLU15" 253 | type: "ReLU" 254 | bottom: "392" 255 | top: "393" 256 | relu_param { 257 | negative_slope: 0.1 258 | } 259 | } 260 | layer { 261 | name: "Convolution16" 262 | type: "Convolution" 263 | bottom: "393" 264 | top: "395" 265 | convolution_param { 266 | num_output: 64 267 | bias_term: false 268 | group: 1 269 | pad_h: 0 270 | pad_w: 0 271 | kernel_h: 1 272 | kernel_w: 1 273 | stride_h: 1 274 | stride_w: 1 275 | 276 | 277 | } 278 | } 279 | layer { 280 | name: "BatchNorm17" 281 | type: "BatchNorm" 282 | bottom: "395" 283 | top: "BatchNorm17" 284 | batch_norm_param { 285 | use_global_stats: true 286 | moving_average_fraction: 0.9 287 | eps: 10e-06 288 | } 289 | } 290 | layer { 291 | name: "Scale17" 292 | type: "Scale" 293 | bottom: "BatchNorm17" 294 | top: "397" 295 | scale_param { 296 | bias_term: true 297 | } 298 | } 299 | layer { 300 | name: "ReLU18" 301 | type: "ReLU" 302 | bottom: "397" 303 | top: "398" 304 | relu_param { 305 | negative_slope: 0.1 306 | } 307 | } 308 | layer { 309 | name: "Convolution19" 310 | type: "Convolution" 311 | bottom: "398" 312 | top: "400" 313 | convolution_param { 314 | num_output: 128 315 | bias_term: false 316 | group: 1 317 | pad_h: 1 318 | pad_w: 1 319 | kernel_h: 3 320 | kernel_w: 3 321 | stride_h: 1 322 | stride_w: 1 323 | 324 | 325 | } 326 | } 327 | layer { 328 | name: "BatchNorm20" 329 | type: "BatchNorm" 330 | bottom: "400" 331 | top: "BatchNorm20" 332 | batch_norm_param { 333 | use_global_stats: true 334 | moving_average_fraction: 0.9 335 | eps: 10e-06 336 | } 337 | } 338 | layer { 339 | name: "Scale20" 340 | type: "Scale" 341 | bottom: "BatchNorm20" 342 | top: "402" 343 | scale_param { 344 | bias_term: true 345 | } 346 | } 347 | layer { 348 | name: "ReLU21" 349 | type: "ReLU" 350 | bottom: "402" 351 | top: "403" 352 | relu_param { 353 | negative_slope: 0.1 354 | } 355 | } 356 | layer { 357 | name: "Eltwise22" 358 | type: "Eltwise" 359 | bottom: "403" 360 | bottom: "393" 361 | top: "404" 362 | eltwise_param { 363 | operation: SUM 364 | coeff: 1 365 | coeff: 1 366 | } 367 | } 368 | layer { 369 | name: "Convolution23" 370 | type: "Convolution" 371 | bottom: "404" 372 | top: "406" 373 | convolution_param { 374 | num_output: 64 375 | bias_term: false 376 | group: 1 377 | pad_h: 0 378 | pad_w: 0 379 | kernel_h: 1 380 | kernel_w: 1 381 | stride_h: 1 382 | stride_w: 1 383 | 384 | 385 | } 386 | } 387 | layer { 388 | name: "BatchNorm24" 389 | type: "BatchNorm" 390 | bottom: "406" 391 | top: "BatchNorm24" 392 | batch_norm_param { 393 | use_global_stats: true 394 | moving_average_fraction: 0.9 395 | eps: 10e-06 396 | } 397 | } 398 | layer { 399 | name: "Scale24" 400 | type: "Scale" 401 | bottom: "BatchNorm24" 402 | top: "408" 403 | scale_param { 404 | bias_term: true 405 | } 406 | } 407 | layer { 408 | name: "ReLU25" 409 | type: "ReLU" 410 | bottom: "408" 411 | top: "409" 412 | relu_param { 413 | negative_slope: 0.1 414 | } 415 | } 416 | layer { 417 | name: "Convolution26" 418 | type: "Convolution" 419 | bottom: "409" 420 | top: "411" 421 | convolution_param { 422 | num_output: 128 423 | bias_term: false 424 | group: 1 425 | pad_h: 1 426 | pad_w: 1 427 | kernel_h: 3 428 | kernel_w: 3 429 | stride_h: 1 430 | stride_w: 1 431 | 432 | 433 | } 434 | } 435 | layer { 436 | name: "BatchNorm27" 437 | type: "BatchNorm" 438 | bottom: "411" 439 | top: "BatchNorm27" 440 | batch_norm_param { 441 | use_global_stats: true 442 | moving_average_fraction: 0.9 443 | eps: 10e-06 444 | } 445 | } 446 | layer { 447 | name: "Scale27" 448 | type: "Scale" 449 | bottom: "BatchNorm27" 450 | top: "413" 451 | scale_param { 452 | bias_term: true 453 | } 454 | } 455 | layer { 456 | name: "ReLU28" 457 | type: "ReLU" 458 | bottom: "413" 459 | top: "414" 460 | relu_param { 461 | negative_slope: 0.1 462 | } 463 | } 464 | layer { 465 | name: "Eltwise29" 466 | type: "Eltwise" 467 | bottom: "414" 468 | bottom: "404" 469 | top: "415" 470 | eltwise_param { 471 | operation: SUM 472 | coeff: 1 473 | coeff: 1 474 | } 475 | } 476 | layer { 477 | name: "Convolution30" 478 | type: "Convolution" 479 | bottom: "415" 480 | top: "417" 481 | convolution_param { 482 | num_output: 256 483 | bias_term: false 484 | group: 1 485 | pad_h: 1 486 | pad_w: 1 487 | kernel_h: 3 488 | kernel_w: 3 489 | stride_h: 2 490 | stride_w: 2 491 | 492 | 493 | } 494 | } 495 | layer { 496 | name: "BatchNorm31" 497 | type: "BatchNorm" 498 | bottom: "417" 499 | top: "BatchNorm31" 500 | batch_norm_param { 501 | use_global_stats: true 502 | moving_average_fraction: 0.9 503 | eps: 10e-06 504 | } 505 | } 506 | layer { 507 | name: "Scale31" 508 | type: "Scale" 509 | bottom: "BatchNorm31" 510 | top: "419" 511 | scale_param { 512 | bias_term: true 513 | } 514 | } 515 | layer { 516 | name: "ReLU32" 517 | type: "ReLU" 518 | bottom: "419" 519 | top: "420" 520 | relu_param { 521 | negative_slope: 0.1 522 | } 523 | } 524 | layer { 525 | name: "Convolution33" 526 | type: "Convolution" 527 | bottom: "420" 528 | top: "422" 529 | convolution_param { 530 | num_output: 128 531 | bias_term: false 532 | group: 1 533 | pad_h: 0 534 | pad_w: 0 535 | kernel_h: 1 536 | kernel_w: 1 537 | stride_h: 1 538 | stride_w: 1 539 | 540 | 541 | } 542 | } 543 | layer { 544 | name: "BatchNorm34" 545 | type: "BatchNorm" 546 | bottom: "422" 547 | top: "BatchNorm34" 548 | batch_norm_param { 549 | use_global_stats: true 550 | moving_average_fraction: 0.9 551 | eps: 10e-06 552 | } 553 | } 554 | layer { 555 | name: "Scale34" 556 | type: "Scale" 557 | bottom: "BatchNorm34" 558 | top: "424" 559 | scale_param { 560 | bias_term: true 561 | } 562 | } 563 | layer { 564 | name: "ReLU35" 565 | type: "ReLU" 566 | bottom: "424" 567 | top: "425" 568 | relu_param { 569 | negative_slope: 0.1 570 | } 571 | } 572 | layer { 573 | name: "Convolution36" 574 | type: "Convolution" 575 | bottom: "425" 576 | top: "427" 577 | convolution_param { 578 | num_output: 256 579 | bias_term: false 580 | group: 1 581 | pad_h: 1 582 | pad_w: 1 583 | kernel_h: 3 584 | kernel_w: 3 585 | stride_h: 1 586 | stride_w: 1 587 | 588 | 589 | } 590 | } 591 | layer { 592 | name: "BatchNorm37" 593 | type: "BatchNorm" 594 | bottom: "427" 595 | top: "BatchNorm37" 596 | batch_norm_param { 597 | use_global_stats: true 598 | moving_average_fraction: 0.9 599 | eps: 10e-06 600 | } 601 | } 602 | layer { 603 | name: "Scale37" 604 | type: "Scale" 605 | bottom: "BatchNorm37" 606 | top: "429" 607 | scale_param { 608 | bias_term: true 609 | } 610 | } 611 | layer { 612 | name: "ReLU38" 613 | type: "ReLU" 614 | bottom: "429" 615 | top: "430" 616 | relu_param { 617 | negative_slope: 0.1 618 | } 619 | } 620 | layer { 621 | name: "Eltwise39" 622 | type: "Eltwise" 623 | bottom: "430" 624 | bottom: "420" 625 | top: "431" 626 | eltwise_param { 627 | operation: SUM 628 | coeff: 1 629 | coeff: 1 630 | } 631 | } 632 | layer { 633 | name: "Convolution40" 634 | type: "Convolution" 635 | bottom: "431" 636 | top: "433" 637 | convolution_param { 638 | num_output: 128 639 | bias_term: false 640 | group: 1 641 | pad_h: 0 642 | pad_w: 0 643 | kernel_h: 1 644 | kernel_w: 1 645 | stride_h: 1 646 | stride_w: 1 647 | 648 | 649 | } 650 | } 651 | layer { 652 | name: "BatchNorm41" 653 | type: "BatchNorm" 654 | bottom: "433" 655 | top: "BatchNorm41" 656 | batch_norm_param { 657 | use_global_stats: true 658 | moving_average_fraction: 0.9 659 | eps: 10e-06 660 | } 661 | } 662 | layer { 663 | name: "Scale41" 664 | type: "Scale" 665 | bottom: "BatchNorm41" 666 | top: "435" 667 | scale_param { 668 | bias_term: true 669 | } 670 | } 671 | layer { 672 | name: "ReLU42" 673 | type: "ReLU" 674 | bottom: "435" 675 | top: "436" 676 | relu_param { 677 | negative_slope: 0.1 678 | } 679 | } 680 | layer { 681 | name: "Convolution43" 682 | type: "Convolution" 683 | bottom: "436" 684 | top: "438" 685 | convolution_param { 686 | num_output: 256 687 | bias_term: false 688 | group: 1 689 | pad_h: 1 690 | pad_w: 1 691 | kernel_h: 3 692 | kernel_w: 3 693 | stride_h: 1 694 | stride_w: 1 695 | 696 | 697 | } 698 | } 699 | layer { 700 | name: "BatchNorm44" 701 | type: "BatchNorm" 702 | bottom: "438" 703 | top: "BatchNorm44" 704 | batch_norm_param { 705 | use_global_stats: true 706 | moving_average_fraction: 0.9 707 | eps: 10e-06 708 | } 709 | } 710 | layer { 711 | name: "Scale44" 712 | type: "Scale" 713 | bottom: "BatchNorm44" 714 | top: "440" 715 | scale_param { 716 | bias_term: true 717 | } 718 | } 719 | layer { 720 | name: "ReLU45" 721 | type: "ReLU" 722 | bottom: "440" 723 | top: "441" 724 | relu_param { 725 | negative_slope: 0.1 726 | } 727 | } 728 | layer { 729 | name: "Eltwise46" 730 | type: "Eltwise" 731 | bottom: "441" 732 | bottom: "431" 733 | top: "442" 734 | eltwise_param { 735 | operation: SUM 736 | coeff: 1 737 | coeff: 1 738 | } 739 | } 740 | layer { 741 | name: "Convolution47" 742 | type: "Convolution" 743 | bottom: "442" 744 | top: "444" 745 | convolution_param { 746 | num_output: 128 747 | bias_term: false 748 | group: 1 749 | pad_h: 0 750 | pad_w: 0 751 | kernel_h: 1 752 | kernel_w: 1 753 | stride_h: 1 754 | stride_w: 1 755 | 756 | 757 | } 758 | } 759 | layer { 760 | name: "BatchNorm48" 761 | type: "BatchNorm" 762 | bottom: "444" 763 | top: "BatchNorm48" 764 | batch_norm_param { 765 | use_global_stats: true 766 | moving_average_fraction: 0.9 767 | eps: 10e-06 768 | } 769 | } 770 | layer { 771 | name: "Scale48" 772 | type: "Scale" 773 | bottom: "BatchNorm48" 774 | top: "446" 775 | scale_param { 776 | bias_term: true 777 | } 778 | } 779 | layer { 780 | name: "ReLU49" 781 | type: "ReLU" 782 | bottom: "446" 783 | top: "447" 784 | relu_param { 785 | negative_slope: 0.1 786 | } 787 | } 788 | layer { 789 | name: "Convolution50" 790 | type: "Convolution" 791 | bottom: "447" 792 | top: "449" 793 | convolution_param { 794 | num_output: 256 795 | bias_term: false 796 | group: 1 797 | pad_h: 1 798 | pad_w: 1 799 | kernel_h: 3 800 | kernel_w: 3 801 | stride_h: 1 802 | stride_w: 1 803 | 804 | 805 | } 806 | } 807 | layer { 808 | name: "BatchNorm51" 809 | type: "BatchNorm" 810 | bottom: "449" 811 | top: "BatchNorm51" 812 | batch_norm_param { 813 | use_global_stats: true 814 | moving_average_fraction: 0.9 815 | eps: 10e-06 816 | } 817 | } 818 | layer { 819 | name: "Scale51" 820 | type: "Scale" 821 | bottom: "BatchNorm51" 822 | top: "451" 823 | scale_param { 824 | bias_term: true 825 | } 826 | } 827 | layer { 828 | name: "ReLU52" 829 | type: "ReLU" 830 | bottom: "451" 831 | top: "452" 832 | relu_param { 833 | negative_slope: 0.1 834 | } 835 | } 836 | layer { 837 | name: "Eltwise53" 838 | type: "Eltwise" 839 | bottom: "452" 840 | bottom: "442" 841 | top: "453" 842 | eltwise_param { 843 | operation: SUM 844 | coeff: 1 845 | coeff: 1 846 | } 847 | } 848 | layer { 849 | name: "Convolution54" 850 | type: "Convolution" 851 | bottom: "453" 852 | top: "455" 853 | convolution_param { 854 | num_output: 128 855 | bias_term: false 856 | group: 1 857 | pad_h: 0 858 | pad_w: 0 859 | kernel_h: 1 860 | kernel_w: 1 861 | stride_h: 1 862 | stride_w: 1 863 | 864 | 865 | } 866 | } 867 | layer { 868 | name: "BatchNorm55" 869 | type: "BatchNorm" 870 | bottom: "455" 871 | top: "BatchNorm55" 872 | batch_norm_param { 873 | use_global_stats: true 874 | moving_average_fraction: 0.9 875 | eps: 10e-06 876 | } 877 | } 878 | layer { 879 | name: "Scale55" 880 | type: "Scale" 881 | bottom: "BatchNorm55" 882 | top: "457" 883 | scale_param { 884 | bias_term: true 885 | } 886 | } 887 | layer { 888 | name: "ReLU56" 889 | type: "ReLU" 890 | bottom: "457" 891 | top: "458" 892 | relu_param { 893 | negative_slope: 0.1 894 | } 895 | } 896 | layer { 897 | name: "Convolution57" 898 | type: "Convolution" 899 | bottom: "458" 900 | top: "460" 901 | convolution_param { 902 | num_output: 256 903 | bias_term: false 904 | group: 1 905 | pad_h: 1 906 | pad_w: 1 907 | kernel_h: 3 908 | kernel_w: 3 909 | stride_h: 1 910 | stride_w: 1 911 | 912 | 913 | } 914 | } 915 | layer { 916 | name: "BatchNorm58" 917 | type: "BatchNorm" 918 | bottom: "460" 919 | top: "BatchNorm58" 920 | batch_norm_param { 921 | use_global_stats: true 922 | moving_average_fraction: 0.9 923 | eps: 10e-06 924 | } 925 | } 926 | layer { 927 | name: "Scale58" 928 | type: "Scale" 929 | bottom: "BatchNorm58" 930 | top: "462" 931 | scale_param { 932 | bias_term: true 933 | } 934 | } 935 | layer { 936 | name: "ReLU59" 937 | type: "ReLU" 938 | bottom: "462" 939 | top: "463" 940 | relu_param { 941 | negative_slope: 0.1 942 | } 943 | } 944 | layer { 945 | name: "Eltwise60" 946 | type: "Eltwise" 947 | bottom: "463" 948 | bottom: "453" 949 | top: "464" 950 | eltwise_param { 951 | operation: SUM 952 | coeff: 1 953 | coeff: 1 954 | } 955 | } 956 | layer { 957 | name: "Convolution61" 958 | type: "Convolution" 959 | bottom: "464" 960 | top: "466" 961 | convolution_param { 962 | num_output: 128 963 | bias_term: false 964 | group: 1 965 | pad_h: 0 966 | pad_w: 0 967 | kernel_h: 1 968 | kernel_w: 1 969 | stride_h: 1 970 | stride_w: 1 971 | 972 | 973 | } 974 | } 975 | layer { 976 | name: "BatchNorm62" 977 | type: "BatchNorm" 978 | bottom: "466" 979 | top: "BatchNorm62" 980 | batch_norm_param { 981 | use_global_stats: true 982 | moving_average_fraction: 0.9 983 | eps: 10e-06 984 | } 985 | } 986 | layer { 987 | name: "Scale62" 988 | type: "Scale" 989 | bottom: "BatchNorm62" 990 | top: "468" 991 | scale_param { 992 | bias_term: true 993 | } 994 | } 995 | layer { 996 | name: "ReLU63" 997 | type: "ReLU" 998 | bottom: "468" 999 | top: "469" 1000 | relu_param { 1001 | negative_slope: 0.1 1002 | } 1003 | } 1004 | layer { 1005 | name: "Convolution64" 1006 | type: "Convolution" 1007 | bottom: "469" 1008 | top: "471" 1009 | convolution_param { 1010 | num_output: 256 1011 | bias_term: false 1012 | group: 1 1013 | pad_h: 1 1014 | pad_w: 1 1015 | kernel_h: 3 1016 | kernel_w: 3 1017 | stride_h: 1 1018 | stride_w: 1 1019 | 1020 | 1021 | } 1022 | } 1023 | layer { 1024 | name: "BatchNorm65" 1025 | type: "BatchNorm" 1026 | bottom: "471" 1027 | top: "BatchNorm65" 1028 | batch_norm_param { 1029 | use_global_stats: true 1030 | moving_average_fraction: 0.9 1031 | eps: 10e-06 1032 | } 1033 | } 1034 | layer { 1035 | name: "Scale65" 1036 | type: "Scale" 1037 | bottom: "BatchNorm65" 1038 | top: "473" 1039 | scale_param { 1040 | bias_term: true 1041 | } 1042 | } 1043 | layer { 1044 | name: "ReLU66" 1045 | type: "ReLU" 1046 | bottom: "473" 1047 | top: "474" 1048 | relu_param { 1049 | negative_slope: 0.1 1050 | } 1051 | } 1052 | layer { 1053 | name: "Eltwise67" 1054 | type: "Eltwise" 1055 | bottom: "474" 1056 | bottom: "464" 1057 | top: "475" 1058 | eltwise_param { 1059 | operation: SUM 1060 | coeff: 1 1061 | coeff: 1 1062 | } 1063 | } 1064 | layer { 1065 | name: "Convolution68" 1066 | type: "Convolution" 1067 | bottom: "475" 1068 | top: "477" 1069 | convolution_param { 1070 | num_output: 128 1071 | bias_term: false 1072 | group: 1 1073 | pad_h: 0 1074 | pad_w: 0 1075 | kernel_h: 1 1076 | kernel_w: 1 1077 | stride_h: 1 1078 | stride_w: 1 1079 | 1080 | 1081 | } 1082 | } 1083 | layer { 1084 | name: "BatchNorm69" 1085 | type: "BatchNorm" 1086 | bottom: "477" 1087 | top: "BatchNorm69" 1088 | batch_norm_param { 1089 | use_global_stats: true 1090 | moving_average_fraction: 0.9 1091 | eps: 10e-06 1092 | } 1093 | } 1094 | layer { 1095 | name: "Scale69" 1096 | type: "Scale" 1097 | bottom: "BatchNorm69" 1098 | top: "479" 1099 | scale_param { 1100 | bias_term: true 1101 | } 1102 | } 1103 | layer { 1104 | name: "ReLU70" 1105 | type: "ReLU" 1106 | bottom: "479" 1107 | top: "480" 1108 | relu_param { 1109 | negative_slope: 0.1 1110 | } 1111 | } 1112 | layer { 1113 | name: "Convolution71" 1114 | type: "Convolution" 1115 | bottom: "480" 1116 | top: "482" 1117 | convolution_param { 1118 | num_output: 256 1119 | bias_term: false 1120 | group: 1 1121 | pad_h: 1 1122 | pad_w: 1 1123 | kernel_h: 3 1124 | kernel_w: 3 1125 | stride_h: 1 1126 | stride_w: 1 1127 | 1128 | 1129 | } 1130 | } 1131 | layer { 1132 | name: "BatchNorm72" 1133 | type: "BatchNorm" 1134 | bottom: "482" 1135 | top: "BatchNorm72" 1136 | batch_norm_param { 1137 | use_global_stats: true 1138 | moving_average_fraction: 0.9 1139 | eps: 10e-06 1140 | } 1141 | } 1142 | layer { 1143 | name: "Scale72" 1144 | type: "Scale" 1145 | bottom: "BatchNorm72" 1146 | top: "484" 1147 | scale_param { 1148 | bias_term: true 1149 | } 1150 | } 1151 | layer { 1152 | name: "ReLU73" 1153 | type: "ReLU" 1154 | bottom: "484" 1155 | top: "485" 1156 | relu_param { 1157 | negative_slope: 0.1 1158 | } 1159 | } 1160 | layer { 1161 | name: "Eltwise74" 1162 | type: "Eltwise" 1163 | bottom: "485" 1164 | bottom: "475" 1165 | top: "486" 1166 | eltwise_param { 1167 | operation: SUM 1168 | coeff: 1 1169 | coeff: 1 1170 | } 1171 | } 1172 | layer { 1173 | name: "Convolution75" 1174 | type: "Convolution" 1175 | bottom: "486" 1176 | top: "488" 1177 | convolution_param { 1178 | num_output: 128 1179 | bias_term: false 1180 | group: 1 1181 | pad_h: 0 1182 | pad_w: 0 1183 | kernel_h: 1 1184 | kernel_w: 1 1185 | stride_h: 1 1186 | stride_w: 1 1187 | 1188 | 1189 | } 1190 | } 1191 | layer { 1192 | name: "BatchNorm76" 1193 | type: "BatchNorm" 1194 | bottom: "488" 1195 | top: "BatchNorm76" 1196 | batch_norm_param { 1197 | use_global_stats: true 1198 | moving_average_fraction: 0.9 1199 | eps: 10e-06 1200 | } 1201 | } 1202 | layer { 1203 | name: "Scale76" 1204 | type: "Scale" 1205 | bottom: "BatchNorm76" 1206 | top: "490" 1207 | scale_param { 1208 | bias_term: true 1209 | } 1210 | } 1211 | layer { 1212 | name: "ReLU77" 1213 | type: "ReLU" 1214 | bottom: "490" 1215 | top: "491" 1216 | relu_param { 1217 | negative_slope: 0.1 1218 | } 1219 | } 1220 | layer { 1221 | name: "Convolution78" 1222 | type: "Convolution" 1223 | bottom: "491" 1224 | top: "493" 1225 | convolution_param { 1226 | num_output: 256 1227 | bias_term: false 1228 | group: 1 1229 | pad_h: 1 1230 | pad_w: 1 1231 | kernel_h: 3 1232 | kernel_w: 3 1233 | stride_h: 1 1234 | stride_w: 1 1235 | 1236 | 1237 | } 1238 | } 1239 | layer { 1240 | name: "BatchNorm79" 1241 | type: "BatchNorm" 1242 | bottom: "493" 1243 | top: "BatchNorm79" 1244 | batch_norm_param { 1245 | use_global_stats: true 1246 | moving_average_fraction: 0.9 1247 | eps: 10e-06 1248 | } 1249 | } 1250 | layer { 1251 | name: "Scale79" 1252 | type: "Scale" 1253 | bottom: "BatchNorm79" 1254 | top: "495" 1255 | scale_param { 1256 | bias_term: true 1257 | } 1258 | } 1259 | layer { 1260 | name: "ReLU80" 1261 | type: "ReLU" 1262 | bottom: "495" 1263 | top: "496" 1264 | relu_param { 1265 | negative_slope: 0.1 1266 | } 1267 | } 1268 | layer { 1269 | name: "Eltwise81" 1270 | type: "Eltwise" 1271 | bottom: "496" 1272 | bottom: "486" 1273 | top: "497" 1274 | eltwise_param { 1275 | operation: SUM 1276 | coeff: 1 1277 | coeff: 1 1278 | } 1279 | } 1280 | layer { 1281 | name: "Convolution82" 1282 | type: "Convolution" 1283 | bottom: "497" 1284 | top: "499" 1285 | convolution_param { 1286 | num_output: 128 1287 | bias_term: false 1288 | group: 1 1289 | pad_h: 0 1290 | pad_w: 0 1291 | kernel_h: 1 1292 | kernel_w: 1 1293 | stride_h: 1 1294 | stride_w: 1 1295 | 1296 | 1297 | } 1298 | } 1299 | layer { 1300 | name: "BatchNorm83" 1301 | type: "BatchNorm" 1302 | bottom: "499" 1303 | top: "BatchNorm83" 1304 | batch_norm_param { 1305 | use_global_stats: true 1306 | moving_average_fraction: 0.9 1307 | eps: 10e-06 1308 | } 1309 | } 1310 | layer { 1311 | name: "Scale83" 1312 | type: "Scale" 1313 | bottom: "BatchNorm83" 1314 | top: "501" 1315 | scale_param { 1316 | bias_term: true 1317 | } 1318 | } 1319 | layer { 1320 | name: "ReLU84" 1321 | type: "ReLU" 1322 | bottom: "501" 1323 | top: "502" 1324 | relu_param { 1325 | negative_slope: 0.1 1326 | } 1327 | } 1328 | layer { 1329 | name: "Convolution85" 1330 | type: "Convolution" 1331 | bottom: "502" 1332 | top: "504" 1333 | convolution_param { 1334 | num_output: 256 1335 | bias_term: false 1336 | group: 1 1337 | pad_h: 1 1338 | pad_w: 1 1339 | kernel_h: 3 1340 | kernel_w: 3 1341 | stride_h: 1 1342 | stride_w: 1 1343 | 1344 | 1345 | } 1346 | } 1347 | layer { 1348 | name: "BatchNorm86" 1349 | type: "BatchNorm" 1350 | bottom: "504" 1351 | top: "BatchNorm86" 1352 | batch_norm_param { 1353 | use_global_stats: true 1354 | moving_average_fraction: 0.9 1355 | eps: 10e-06 1356 | } 1357 | } 1358 | layer { 1359 | name: "Scale86" 1360 | type: "Scale" 1361 | bottom: "BatchNorm86" 1362 | top: "506" 1363 | scale_param { 1364 | bias_term: true 1365 | } 1366 | } 1367 | layer { 1368 | name: "ReLU87" 1369 | type: "ReLU" 1370 | bottom: "506" 1371 | top: "507" 1372 | relu_param { 1373 | negative_slope: 0.1 1374 | } 1375 | } 1376 | layer { 1377 | name: "Eltwise88" 1378 | type: "Eltwise" 1379 | bottom: "507" 1380 | bottom: "497" 1381 | top: "508" 1382 | eltwise_param { 1383 | operation: SUM 1384 | coeff: 1 1385 | coeff: 1 1386 | } 1387 | } 1388 | layer { 1389 | name: "Convolution89" 1390 | type: "Convolution" 1391 | bottom: "508" 1392 | top: "510" 1393 | convolution_param { 1394 | num_output: 512 1395 | bias_term: false 1396 | group: 1 1397 | pad_h: 1 1398 | pad_w: 1 1399 | kernel_h: 3 1400 | kernel_w: 3 1401 | stride_h: 2 1402 | stride_w: 2 1403 | 1404 | 1405 | } 1406 | } 1407 | layer { 1408 | name: "BatchNorm90" 1409 | type: "BatchNorm" 1410 | bottom: "510" 1411 | top: "BatchNorm90" 1412 | batch_norm_param { 1413 | use_global_stats: true 1414 | moving_average_fraction: 0.9 1415 | eps: 10e-06 1416 | } 1417 | } 1418 | layer { 1419 | name: "Scale90" 1420 | type: "Scale" 1421 | bottom: "BatchNorm90" 1422 | top: "512" 1423 | scale_param { 1424 | bias_term: true 1425 | } 1426 | } 1427 | layer { 1428 | name: "ReLU91" 1429 | type: "ReLU" 1430 | bottom: "512" 1431 | top: "513" 1432 | relu_param { 1433 | negative_slope: 0.1 1434 | } 1435 | } 1436 | layer { 1437 | name: "Convolution92" 1438 | type: "Convolution" 1439 | bottom: "513" 1440 | top: "515" 1441 | convolution_param { 1442 | num_output: 256 1443 | bias_term: false 1444 | group: 1 1445 | pad_h: 0 1446 | pad_w: 0 1447 | kernel_h: 1 1448 | kernel_w: 1 1449 | stride_h: 1 1450 | stride_w: 1 1451 | 1452 | 1453 | } 1454 | } 1455 | layer { 1456 | name: "BatchNorm93" 1457 | type: "BatchNorm" 1458 | bottom: "515" 1459 | top: "BatchNorm93" 1460 | batch_norm_param { 1461 | use_global_stats: true 1462 | moving_average_fraction: 0.9 1463 | eps: 10e-06 1464 | } 1465 | } 1466 | layer { 1467 | name: "Scale93" 1468 | type: "Scale" 1469 | bottom: "BatchNorm93" 1470 | top: "517" 1471 | scale_param { 1472 | bias_term: true 1473 | } 1474 | } 1475 | layer { 1476 | name: "ReLU94" 1477 | type: "ReLU" 1478 | bottom: "517" 1479 | top: "518" 1480 | relu_param { 1481 | negative_slope: 0.1 1482 | } 1483 | } 1484 | layer { 1485 | name: "Convolution95" 1486 | type: "Convolution" 1487 | bottom: "518" 1488 | top: "520" 1489 | convolution_param { 1490 | num_output: 512 1491 | bias_term: false 1492 | group: 1 1493 | pad_h: 1 1494 | pad_w: 1 1495 | kernel_h: 3 1496 | kernel_w: 3 1497 | stride_h: 1 1498 | stride_w: 1 1499 | 1500 | 1501 | } 1502 | } 1503 | layer { 1504 | name: "BatchNorm96" 1505 | type: "BatchNorm" 1506 | bottom: "520" 1507 | top: "BatchNorm96" 1508 | batch_norm_param { 1509 | use_global_stats: true 1510 | moving_average_fraction: 0.9 1511 | eps: 10e-06 1512 | } 1513 | } 1514 | layer { 1515 | name: "Scale96" 1516 | type: "Scale" 1517 | bottom: "BatchNorm96" 1518 | top: "522" 1519 | scale_param { 1520 | bias_term: true 1521 | } 1522 | } 1523 | layer { 1524 | name: "ReLU97" 1525 | type: "ReLU" 1526 | bottom: "522" 1527 | top: "523" 1528 | relu_param { 1529 | negative_slope: 0.1 1530 | } 1531 | } 1532 | layer { 1533 | name: "Eltwise98" 1534 | type: "Eltwise" 1535 | bottom: "523" 1536 | bottom: "513" 1537 | top: "524" 1538 | eltwise_param { 1539 | operation: SUM 1540 | coeff: 1 1541 | coeff: 1 1542 | } 1543 | } 1544 | layer { 1545 | name: "Convolution99" 1546 | type: "Convolution" 1547 | bottom: "524" 1548 | top: "526" 1549 | convolution_param { 1550 | num_output: 256 1551 | bias_term: false 1552 | group: 1 1553 | pad_h: 0 1554 | pad_w: 0 1555 | kernel_h: 1 1556 | kernel_w: 1 1557 | stride_h: 1 1558 | stride_w: 1 1559 | 1560 | 1561 | } 1562 | } 1563 | layer { 1564 | name: "BatchNorm100" 1565 | type: "BatchNorm" 1566 | bottom: "526" 1567 | top: "BatchNorm100" 1568 | batch_norm_param { 1569 | use_global_stats: true 1570 | moving_average_fraction: 0.9 1571 | eps: 10e-06 1572 | } 1573 | } 1574 | layer { 1575 | name: "Scale100" 1576 | type: "Scale" 1577 | bottom: "BatchNorm100" 1578 | top: "528" 1579 | scale_param { 1580 | bias_term: true 1581 | } 1582 | } 1583 | layer { 1584 | name: "ReLU101" 1585 | type: "ReLU" 1586 | bottom: "528" 1587 | top: "529" 1588 | relu_param { 1589 | negative_slope: 0.1 1590 | } 1591 | } 1592 | layer { 1593 | name: "Convolution102" 1594 | type: "Convolution" 1595 | bottom: "529" 1596 | top: "531" 1597 | convolution_param { 1598 | num_output: 512 1599 | bias_term: false 1600 | group: 1 1601 | pad_h: 1 1602 | pad_w: 1 1603 | kernel_h: 3 1604 | kernel_w: 3 1605 | stride_h: 1 1606 | stride_w: 1 1607 | 1608 | 1609 | } 1610 | } 1611 | layer { 1612 | name: "BatchNorm103" 1613 | type: "BatchNorm" 1614 | bottom: "531" 1615 | top: "BatchNorm103" 1616 | batch_norm_param { 1617 | use_global_stats: true 1618 | moving_average_fraction: 0.9 1619 | eps: 10e-06 1620 | } 1621 | } 1622 | layer { 1623 | name: "Scale103" 1624 | type: "Scale" 1625 | bottom: "BatchNorm103" 1626 | top: "533" 1627 | scale_param { 1628 | bias_term: true 1629 | } 1630 | } 1631 | layer { 1632 | name: "ReLU104" 1633 | type: "ReLU" 1634 | bottom: "533" 1635 | top: "534" 1636 | relu_param { 1637 | negative_slope: 0.1 1638 | } 1639 | } 1640 | layer { 1641 | name: "Eltwise105" 1642 | type: "Eltwise" 1643 | bottom: "534" 1644 | bottom: "524" 1645 | top: "535" 1646 | eltwise_param { 1647 | operation: SUM 1648 | coeff: 1 1649 | coeff: 1 1650 | } 1651 | } 1652 | layer { 1653 | name: "Convolution106" 1654 | type: "Convolution" 1655 | bottom: "535" 1656 | top: "537" 1657 | convolution_param { 1658 | num_output: 256 1659 | bias_term: false 1660 | group: 1 1661 | pad_h: 0 1662 | pad_w: 0 1663 | kernel_h: 1 1664 | kernel_w: 1 1665 | stride_h: 1 1666 | stride_w: 1 1667 | 1668 | 1669 | } 1670 | } 1671 | layer { 1672 | name: "BatchNorm107" 1673 | type: "BatchNorm" 1674 | bottom: "537" 1675 | top: "BatchNorm107" 1676 | batch_norm_param { 1677 | use_global_stats: true 1678 | moving_average_fraction: 0.9 1679 | eps: 10e-06 1680 | } 1681 | } 1682 | layer { 1683 | name: "Scale107" 1684 | type: "Scale" 1685 | bottom: "BatchNorm107" 1686 | top: "539" 1687 | scale_param { 1688 | bias_term: true 1689 | } 1690 | } 1691 | layer { 1692 | name: "ReLU108" 1693 | type: "ReLU" 1694 | bottom: "539" 1695 | top: "540" 1696 | relu_param { 1697 | negative_slope: 0.1 1698 | } 1699 | } 1700 | layer { 1701 | name: "Convolution109" 1702 | type: "Convolution" 1703 | bottom: "540" 1704 | top: "542" 1705 | convolution_param { 1706 | num_output: 512 1707 | bias_term: false 1708 | group: 1 1709 | pad_h: 1 1710 | pad_w: 1 1711 | kernel_h: 3 1712 | kernel_w: 3 1713 | stride_h: 1 1714 | stride_w: 1 1715 | 1716 | 1717 | } 1718 | } 1719 | layer { 1720 | name: "BatchNorm110" 1721 | type: "BatchNorm" 1722 | bottom: "542" 1723 | top: "BatchNorm110" 1724 | batch_norm_param { 1725 | use_global_stats: true 1726 | moving_average_fraction: 0.9 1727 | eps: 10e-06 1728 | } 1729 | } 1730 | layer { 1731 | name: "Scale110" 1732 | type: "Scale" 1733 | bottom: "BatchNorm110" 1734 | top: "544" 1735 | scale_param { 1736 | bias_term: true 1737 | } 1738 | } 1739 | layer { 1740 | name: "ReLU111" 1741 | type: "ReLU" 1742 | bottom: "544" 1743 | top: "545" 1744 | relu_param { 1745 | negative_slope: 0.1 1746 | } 1747 | } 1748 | layer { 1749 | name: "Eltwise112" 1750 | type: "Eltwise" 1751 | bottom: "545" 1752 | bottom: "535" 1753 | top: "546" 1754 | eltwise_param { 1755 | operation: SUM 1756 | coeff: 1 1757 | coeff: 1 1758 | } 1759 | } 1760 | layer { 1761 | name: "Convolution113" 1762 | type: "Convolution" 1763 | bottom: "546" 1764 | top: "548" 1765 | convolution_param { 1766 | num_output: 256 1767 | bias_term: false 1768 | group: 1 1769 | pad_h: 0 1770 | pad_w: 0 1771 | kernel_h: 1 1772 | kernel_w: 1 1773 | stride_h: 1 1774 | stride_w: 1 1775 | 1776 | 1777 | } 1778 | } 1779 | layer { 1780 | name: "BatchNorm114" 1781 | type: "BatchNorm" 1782 | bottom: "548" 1783 | top: "BatchNorm114" 1784 | batch_norm_param { 1785 | use_global_stats: true 1786 | moving_average_fraction: 0.9 1787 | eps: 10e-06 1788 | } 1789 | } 1790 | layer { 1791 | name: "Scale114" 1792 | type: "Scale" 1793 | bottom: "BatchNorm114" 1794 | top: "550" 1795 | scale_param { 1796 | bias_term: true 1797 | } 1798 | } 1799 | layer { 1800 | name: "ReLU115" 1801 | type: "ReLU" 1802 | bottom: "550" 1803 | top: "551" 1804 | relu_param { 1805 | negative_slope: 0.1 1806 | } 1807 | } 1808 | layer { 1809 | name: "Convolution116" 1810 | type: "Convolution" 1811 | bottom: "551" 1812 | top: "553" 1813 | convolution_param { 1814 | num_output: 512 1815 | bias_term: false 1816 | group: 1 1817 | pad_h: 1 1818 | pad_w: 1 1819 | kernel_h: 3 1820 | kernel_w: 3 1821 | stride_h: 1 1822 | stride_w: 1 1823 | 1824 | 1825 | } 1826 | } 1827 | layer { 1828 | name: "BatchNorm117" 1829 | type: "BatchNorm" 1830 | bottom: "553" 1831 | top: "BatchNorm117" 1832 | batch_norm_param { 1833 | use_global_stats: true 1834 | moving_average_fraction: 0.9 1835 | eps: 10e-06 1836 | } 1837 | } 1838 | layer { 1839 | name: "Scale117" 1840 | type: "Scale" 1841 | bottom: "BatchNorm117" 1842 | top: "555" 1843 | scale_param { 1844 | bias_term: true 1845 | } 1846 | } 1847 | layer { 1848 | name: "ReLU118" 1849 | type: "ReLU" 1850 | bottom: "555" 1851 | top: "556" 1852 | relu_param { 1853 | negative_slope: 0.1 1854 | } 1855 | } 1856 | layer { 1857 | name: "Eltwise119" 1858 | type: "Eltwise" 1859 | bottom: "556" 1860 | bottom: "546" 1861 | top: "557" 1862 | eltwise_param { 1863 | operation: SUM 1864 | coeff: 1 1865 | coeff: 1 1866 | } 1867 | } 1868 | layer { 1869 | name: "Convolution120" 1870 | type: "Convolution" 1871 | bottom: "557" 1872 | top: "559" 1873 | convolution_param { 1874 | num_output: 256 1875 | bias_term: false 1876 | group: 1 1877 | pad_h: 0 1878 | pad_w: 0 1879 | kernel_h: 1 1880 | kernel_w: 1 1881 | stride_h: 1 1882 | stride_w: 1 1883 | 1884 | 1885 | } 1886 | } 1887 | layer { 1888 | name: "BatchNorm121" 1889 | type: "BatchNorm" 1890 | bottom: "559" 1891 | top: "BatchNorm121" 1892 | batch_norm_param { 1893 | use_global_stats: true 1894 | moving_average_fraction: 0.9 1895 | eps: 10e-06 1896 | } 1897 | } 1898 | layer { 1899 | name: "Scale121" 1900 | type: "Scale" 1901 | bottom: "BatchNorm121" 1902 | top: "561" 1903 | scale_param { 1904 | bias_term: true 1905 | } 1906 | } 1907 | layer { 1908 | name: "ReLU122" 1909 | type: "ReLU" 1910 | bottom: "561" 1911 | top: "562" 1912 | relu_param { 1913 | negative_slope: 0.1 1914 | } 1915 | } 1916 | layer { 1917 | name: "Convolution123" 1918 | type: "Convolution" 1919 | bottom: "562" 1920 | top: "564" 1921 | convolution_param { 1922 | num_output: 512 1923 | bias_term: false 1924 | group: 1 1925 | pad_h: 1 1926 | pad_w: 1 1927 | kernel_h: 3 1928 | kernel_w: 3 1929 | stride_h: 1 1930 | stride_w: 1 1931 | 1932 | 1933 | } 1934 | } 1935 | layer { 1936 | name: "BatchNorm124" 1937 | type: "BatchNorm" 1938 | bottom: "564" 1939 | top: "BatchNorm124" 1940 | batch_norm_param { 1941 | use_global_stats: true 1942 | moving_average_fraction: 0.9 1943 | eps: 10e-06 1944 | } 1945 | } 1946 | layer { 1947 | name: "Scale124" 1948 | type: "Scale" 1949 | bottom: "BatchNorm124" 1950 | top: "566" 1951 | scale_param { 1952 | bias_term: true 1953 | } 1954 | } 1955 | layer { 1956 | name: "ReLU125" 1957 | type: "ReLU" 1958 | bottom: "566" 1959 | top: "567" 1960 | relu_param { 1961 | negative_slope: 0.1 1962 | } 1963 | } 1964 | layer { 1965 | name: "Eltwise126" 1966 | type: "Eltwise" 1967 | bottom: "567" 1968 | bottom: "557" 1969 | top: "568" 1970 | eltwise_param { 1971 | operation: SUM 1972 | coeff: 1 1973 | coeff: 1 1974 | } 1975 | } 1976 | layer { 1977 | name: "Convolution127" 1978 | type: "Convolution" 1979 | bottom: "568" 1980 | top: "570" 1981 | convolution_param { 1982 | num_output: 256 1983 | bias_term: false 1984 | group: 1 1985 | pad_h: 0 1986 | pad_w: 0 1987 | kernel_h: 1 1988 | kernel_w: 1 1989 | stride_h: 1 1990 | stride_w: 1 1991 | 1992 | 1993 | } 1994 | } 1995 | layer { 1996 | name: "BatchNorm128" 1997 | type: "BatchNorm" 1998 | bottom: "570" 1999 | top: "BatchNorm128" 2000 | batch_norm_param { 2001 | use_global_stats: true 2002 | moving_average_fraction: 0.9 2003 | eps: 10e-06 2004 | } 2005 | } 2006 | layer { 2007 | name: "Scale128" 2008 | type: "Scale" 2009 | bottom: "BatchNorm128" 2010 | top: "572" 2011 | scale_param { 2012 | bias_term: true 2013 | } 2014 | } 2015 | layer { 2016 | name: "ReLU129" 2017 | type: "ReLU" 2018 | bottom: "572" 2019 | top: "573" 2020 | relu_param { 2021 | negative_slope: 0.1 2022 | } 2023 | } 2024 | layer { 2025 | name: "Convolution130" 2026 | type: "Convolution" 2027 | bottom: "573" 2028 | top: "575" 2029 | convolution_param { 2030 | num_output: 512 2031 | bias_term: false 2032 | group: 1 2033 | pad_h: 1 2034 | pad_w: 1 2035 | kernel_h: 3 2036 | kernel_w: 3 2037 | stride_h: 1 2038 | stride_w: 1 2039 | 2040 | 2041 | } 2042 | } 2043 | layer { 2044 | name: "BatchNorm131" 2045 | type: "BatchNorm" 2046 | bottom: "575" 2047 | top: "BatchNorm131" 2048 | batch_norm_param { 2049 | use_global_stats: true 2050 | moving_average_fraction: 0.9 2051 | eps: 10e-06 2052 | } 2053 | } 2054 | layer { 2055 | name: "Scale131" 2056 | type: "Scale" 2057 | bottom: "BatchNorm131" 2058 | top: "577" 2059 | scale_param { 2060 | bias_term: true 2061 | } 2062 | } 2063 | layer { 2064 | name: "ReLU132" 2065 | type: "ReLU" 2066 | bottom: "577" 2067 | top: "578" 2068 | relu_param { 2069 | negative_slope: 0.1 2070 | } 2071 | } 2072 | layer { 2073 | name: "Eltwise133" 2074 | type: "Eltwise" 2075 | bottom: "578" 2076 | bottom: "568" 2077 | top: "579" 2078 | eltwise_param { 2079 | operation: SUM 2080 | coeff: 1 2081 | coeff: 1 2082 | } 2083 | } 2084 | layer { 2085 | name: "Convolution134" 2086 | type: "Convolution" 2087 | bottom: "579" 2088 | top: "581" 2089 | convolution_param { 2090 | num_output: 256 2091 | bias_term: false 2092 | group: 1 2093 | pad_h: 0 2094 | pad_w: 0 2095 | kernel_h: 1 2096 | kernel_w: 1 2097 | stride_h: 1 2098 | stride_w: 1 2099 | 2100 | 2101 | } 2102 | } 2103 | layer { 2104 | name: "BatchNorm135" 2105 | type: "BatchNorm" 2106 | bottom: "581" 2107 | top: "BatchNorm135" 2108 | batch_norm_param { 2109 | use_global_stats: true 2110 | moving_average_fraction: 0.9 2111 | eps: 10e-06 2112 | } 2113 | } 2114 | layer { 2115 | name: "Scale135" 2116 | type: "Scale" 2117 | bottom: "BatchNorm135" 2118 | top: "583" 2119 | scale_param { 2120 | bias_term: true 2121 | } 2122 | } 2123 | layer { 2124 | name: "ReLU136" 2125 | type: "ReLU" 2126 | bottom: "583" 2127 | top: "584" 2128 | relu_param { 2129 | negative_slope: 0.1 2130 | } 2131 | } 2132 | layer { 2133 | name: "Convolution137" 2134 | type: "Convolution" 2135 | bottom: "584" 2136 | top: "586" 2137 | convolution_param { 2138 | num_output: 512 2139 | bias_term: false 2140 | group: 1 2141 | pad_h: 1 2142 | pad_w: 1 2143 | kernel_h: 3 2144 | kernel_w: 3 2145 | stride_h: 1 2146 | stride_w: 1 2147 | 2148 | 2149 | } 2150 | } 2151 | layer { 2152 | name: "BatchNorm138" 2153 | type: "BatchNorm" 2154 | bottom: "586" 2155 | top: "BatchNorm138" 2156 | batch_norm_param { 2157 | use_global_stats: true 2158 | moving_average_fraction: 0.9 2159 | eps: 10e-06 2160 | } 2161 | } 2162 | layer { 2163 | name: "Scale138" 2164 | type: "Scale" 2165 | bottom: "BatchNorm138" 2166 | top: "588" 2167 | scale_param { 2168 | bias_term: true 2169 | } 2170 | } 2171 | layer { 2172 | name: "ReLU139" 2173 | type: "ReLU" 2174 | bottom: "588" 2175 | top: "589" 2176 | relu_param { 2177 | negative_slope: 0.1 2178 | } 2179 | } 2180 | layer { 2181 | name: "Eltwise140" 2182 | type: "Eltwise" 2183 | bottom: "589" 2184 | bottom: "579" 2185 | top: "590" 2186 | eltwise_param { 2187 | operation: SUM 2188 | coeff: 1 2189 | coeff: 1 2190 | } 2191 | } 2192 | layer { 2193 | name: "Convolution141" 2194 | type: "Convolution" 2195 | bottom: "590" 2196 | top: "592" 2197 | convolution_param { 2198 | num_output: 256 2199 | bias_term: false 2200 | group: 1 2201 | pad_h: 0 2202 | pad_w: 0 2203 | kernel_h: 1 2204 | kernel_w: 1 2205 | stride_h: 1 2206 | stride_w: 1 2207 | 2208 | 2209 | } 2210 | } 2211 | layer { 2212 | name: "BatchNorm142" 2213 | type: "BatchNorm" 2214 | bottom: "592" 2215 | top: "BatchNorm142" 2216 | batch_norm_param { 2217 | use_global_stats: true 2218 | moving_average_fraction: 0.9 2219 | eps: 10e-06 2220 | } 2221 | } 2222 | layer { 2223 | name: "Scale142" 2224 | type: "Scale" 2225 | bottom: "BatchNorm142" 2226 | top: "594" 2227 | scale_param { 2228 | bias_term: true 2229 | } 2230 | } 2231 | layer { 2232 | name: "ReLU143" 2233 | type: "ReLU" 2234 | bottom: "594" 2235 | top: "595" 2236 | relu_param { 2237 | negative_slope: 0.1 2238 | } 2239 | } 2240 | layer { 2241 | name: "Convolution144" 2242 | type: "Convolution" 2243 | bottom: "595" 2244 | top: "597" 2245 | convolution_param { 2246 | num_output: 512 2247 | bias_term: false 2248 | group: 1 2249 | pad_h: 1 2250 | pad_w: 1 2251 | kernel_h: 3 2252 | kernel_w: 3 2253 | stride_h: 1 2254 | stride_w: 1 2255 | 2256 | 2257 | } 2258 | } 2259 | layer { 2260 | name: "BatchNorm145" 2261 | type: "BatchNorm" 2262 | bottom: "597" 2263 | top: "BatchNorm145" 2264 | batch_norm_param { 2265 | use_global_stats: true 2266 | moving_average_fraction: 0.9 2267 | eps: 10e-06 2268 | } 2269 | } 2270 | layer { 2271 | name: "Scale145" 2272 | type: "Scale" 2273 | bottom: "BatchNorm145" 2274 | top: "599" 2275 | scale_param { 2276 | bias_term: true 2277 | } 2278 | } 2279 | layer { 2280 | name: "ReLU146" 2281 | type: "ReLU" 2282 | bottom: "599" 2283 | top: "600" 2284 | relu_param { 2285 | negative_slope: 0.1 2286 | } 2287 | } 2288 | layer { 2289 | name: "Eltwise147" 2290 | type: "Eltwise" 2291 | bottom: "600" 2292 | bottom: "590" 2293 | top: "601" 2294 | eltwise_param { 2295 | operation: SUM 2296 | coeff: 1 2297 | coeff: 1 2298 | } 2299 | } 2300 | layer { 2301 | name: "Convolution148" 2302 | type: "Convolution" 2303 | bottom: "601" 2304 | top: "603" 2305 | convolution_param { 2306 | num_output: 1024 2307 | bias_term: false 2308 | group: 1 2309 | pad_h: 1 2310 | pad_w: 1 2311 | kernel_h: 3 2312 | kernel_w: 3 2313 | stride_h: 2 2314 | stride_w: 2 2315 | 2316 | 2317 | } 2318 | } 2319 | layer { 2320 | name: "BatchNorm149" 2321 | type: "BatchNorm" 2322 | bottom: "603" 2323 | top: "BatchNorm149" 2324 | batch_norm_param { 2325 | use_global_stats: true 2326 | moving_average_fraction: 0.9 2327 | eps: 10e-06 2328 | } 2329 | } 2330 | layer { 2331 | name: "Scale149" 2332 | type: "Scale" 2333 | bottom: "BatchNorm149" 2334 | top: "605" 2335 | scale_param { 2336 | bias_term: true 2337 | } 2338 | } 2339 | layer { 2340 | name: "ReLU150" 2341 | type: "ReLU" 2342 | bottom: "605" 2343 | top: "606" 2344 | relu_param { 2345 | negative_slope: 0.1 2346 | } 2347 | } 2348 | layer { 2349 | name: "Convolution151" 2350 | type: "Convolution" 2351 | bottom: "606" 2352 | top: "608" 2353 | convolution_param { 2354 | num_output: 512 2355 | bias_term: false 2356 | group: 1 2357 | pad_h: 0 2358 | pad_w: 0 2359 | kernel_h: 1 2360 | kernel_w: 1 2361 | stride_h: 1 2362 | stride_w: 1 2363 | 2364 | 2365 | } 2366 | } 2367 | layer { 2368 | name: "BatchNorm152" 2369 | type: "BatchNorm" 2370 | bottom: "608" 2371 | top: "BatchNorm152" 2372 | batch_norm_param { 2373 | use_global_stats: true 2374 | moving_average_fraction: 0.9 2375 | eps: 10e-06 2376 | } 2377 | } 2378 | layer { 2379 | name: "Scale152" 2380 | type: "Scale" 2381 | bottom: "BatchNorm152" 2382 | top: "610" 2383 | scale_param { 2384 | bias_term: true 2385 | } 2386 | } 2387 | layer { 2388 | name: "ReLU153" 2389 | type: "ReLU" 2390 | bottom: "610" 2391 | top: "611" 2392 | relu_param { 2393 | negative_slope: 0.1 2394 | } 2395 | } 2396 | layer { 2397 | name: "Convolution154" 2398 | type: "Convolution" 2399 | bottom: "611" 2400 | top: "613" 2401 | convolution_param { 2402 | num_output: 1024 2403 | bias_term: false 2404 | group: 1 2405 | pad_h: 1 2406 | pad_w: 1 2407 | kernel_h: 3 2408 | kernel_w: 3 2409 | stride_h: 1 2410 | stride_w: 1 2411 | 2412 | 2413 | } 2414 | } 2415 | layer { 2416 | name: "BatchNorm155" 2417 | type: "BatchNorm" 2418 | bottom: "613" 2419 | top: "BatchNorm155" 2420 | batch_norm_param { 2421 | use_global_stats: true 2422 | moving_average_fraction: 0.9 2423 | eps: 10e-06 2424 | } 2425 | } 2426 | layer { 2427 | name: "Scale155" 2428 | type: "Scale" 2429 | bottom: "BatchNorm155" 2430 | top: "615" 2431 | scale_param { 2432 | bias_term: true 2433 | } 2434 | } 2435 | layer { 2436 | name: "ReLU156" 2437 | type: "ReLU" 2438 | bottom: "615" 2439 | top: "616" 2440 | relu_param { 2441 | negative_slope: 0.1 2442 | } 2443 | } 2444 | layer { 2445 | name: "Eltwise157" 2446 | type: "Eltwise" 2447 | bottom: "616" 2448 | bottom: "606" 2449 | top: "617" 2450 | eltwise_param { 2451 | operation: SUM 2452 | coeff: 1 2453 | coeff: 1 2454 | } 2455 | } 2456 | layer { 2457 | name: "Convolution158" 2458 | type: "Convolution" 2459 | bottom: "617" 2460 | top: "619" 2461 | convolution_param { 2462 | num_output: 512 2463 | bias_term: false 2464 | group: 1 2465 | pad_h: 0 2466 | pad_w: 0 2467 | kernel_h: 1 2468 | kernel_w: 1 2469 | stride_h: 1 2470 | stride_w: 1 2471 | 2472 | 2473 | } 2474 | } 2475 | layer { 2476 | name: "BatchNorm159" 2477 | type: "BatchNorm" 2478 | bottom: "619" 2479 | top: "BatchNorm159" 2480 | batch_norm_param { 2481 | use_global_stats: true 2482 | moving_average_fraction: 0.9 2483 | eps: 10e-06 2484 | } 2485 | } 2486 | layer { 2487 | name: "Scale159" 2488 | type: "Scale" 2489 | bottom: "BatchNorm159" 2490 | top: "621" 2491 | scale_param { 2492 | bias_term: true 2493 | } 2494 | } 2495 | layer { 2496 | name: "ReLU160" 2497 | type: "ReLU" 2498 | bottom: "621" 2499 | top: "622" 2500 | relu_param { 2501 | negative_slope: 0.1 2502 | } 2503 | } 2504 | layer { 2505 | name: "Convolution161" 2506 | type: "Convolution" 2507 | bottom: "622" 2508 | top: "624" 2509 | convolution_param { 2510 | num_output: 1024 2511 | bias_term: false 2512 | group: 1 2513 | pad_h: 1 2514 | pad_w: 1 2515 | kernel_h: 3 2516 | kernel_w: 3 2517 | stride_h: 1 2518 | stride_w: 1 2519 | 2520 | 2521 | } 2522 | } 2523 | layer { 2524 | name: "BatchNorm162" 2525 | type: "BatchNorm" 2526 | bottom: "624" 2527 | top: "BatchNorm162" 2528 | batch_norm_param { 2529 | use_global_stats: true 2530 | moving_average_fraction: 0.9 2531 | eps: 10e-06 2532 | } 2533 | } 2534 | layer { 2535 | name: "Scale162" 2536 | type: "Scale" 2537 | bottom: "BatchNorm162" 2538 | top: "626" 2539 | scale_param { 2540 | bias_term: true 2541 | } 2542 | } 2543 | layer { 2544 | name: "ReLU163" 2545 | type: "ReLU" 2546 | bottom: "626" 2547 | top: "627" 2548 | relu_param { 2549 | negative_slope: 0.1 2550 | } 2551 | } 2552 | layer { 2553 | name: "Eltwise164" 2554 | type: "Eltwise" 2555 | bottom: "627" 2556 | bottom: "617" 2557 | top: "628" 2558 | eltwise_param { 2559 | operation: SUM 2560 | coeff: 1 2561 | coeff: 1 2562 | } 2563 | } 2564 | layer { 2565 | name: "Convolution165" 2566 | type: "Convolution" 2567 | bottom: "628" 2568 | top: "630" 2569 | convolution_param { 2570 | num_output: 512 2571 | bias_term: false 2572 | group: 1 2573 | pad_h: 0 2574 | pad_w: 0 2575 | kernel_h: 1 2576 | kernel_w: 1 2577 | stride_h: 1 2578 | stride_w: 1 2579 | 2580 | 2581 | } 2582 | } 2583 | layer { 2584 | name: "BatchNorm166" 2585 | type: "BatchNorm" 2586 | bottom: "630" 2587 | top: "BatchNorm166" 2588 | batch_norm_param { 2589 | use_global_stats: true 2590 | moving_average_fraction: 0.9 2591 | eps: 10e-06 2592 | } 2593 | } 2594 | layer { 2595 | name: "Scale166" 2596 | type: "Scale" 2597 | bottom: "BatchNorm166" 2598 | top: "632" 2599 | scale_param { 2600 | bias_term: true 2601 | } 2602 | } 2603 | layer { 2604 | name: "ReLU167" 2605 | type: "ReLU" 2606 | bottom: "632" 2607 | top: "633" 2608 | relu_param { 2609 | negative_slope: 0.1 2610 | } 2611 | } 2612 | layer { 2613 | name: "Convolution168" 2614 | type: "Convolution" 2615 | bottom: "633" 2616 | top: "635" 2617 | convolution_param { 2618 | num_output: 1024 2619 | bias_term: false 2620 | group: 1 2621 | pad_h: 1 2622 | pad_w: 1 2623 | kernel_h: 3 2624 | kernel_w: 3 2625 | stride_h: 1 2626 | stride_w: 1 2627 | 2628 | 2629 | } 2630 | } 2631 | layer { 2632 | name: "BatchNorm169" 2633 | type: "BatchNorm" 2634 | bottom: "635" 2635 | top: "BatchNorm169" 2636 | batch_norm_param { 2637 | use_global_stats: true 2638 | moving_average_fraction: 0.9 2639 | eps: 10e-06 2640 | } 2641 | } 2642 | layer { 2643 | name: "Scale169" 2644 | type: "Scale" 2645 | bottom: "BatchNorm169" 2646 | top: "637" 2647 | scale_param { 2648 | bias_term: true 2649 | } 2650 | } 2651 | layer { 2652 | name: "ReLU170" 2653 | type: "ReLU" 2654 | bottom: "637" 2655 | top: "638" 2656 | relu_param { 2657 | negative_slope: 0.1 2658 | } 2659 | } 2660 | layer { 2661 | name: "Eltwise171" 2662 | type: "Eltwise" 2663 | bottom: "638" 2664 | bottom: "628" 2665 | top: "639" 2666 | eltwise_param { 2667 | operation: SUM 2668 | coeff: 1 2669 | coeff: 1 2670 | } 2671 | } 2672 | layer { 2673 | name: "Convolution172" 2674 | type: "Convolution" 2675 | bottom: "639" 2676 | top: "641" 2677 | convolution_param { 2678 | num_output: 512 2679 | bias_term: false 2680 | group: 1 2681 | pad_h: 0 2682 | pad_w: 0 2683 | kernel_h: 1 2684 | kernel_w: 1 2685 | stride_h: 1 2686 | stride_w: 1 2687 | 2688 | 2689 | } 2690 | } 2691 | layer { 2692 | name: "BatchNorm173" 2693 | type: "BatchNorm" 2694 | bottom: "641" 2695 | top: "BatchNorm173" 2696 | batch_norm_param { 2697 | use_global_stats: true 2698 | moving_average_fraction: 0.9 2699 | eps: 10e-06 2700 | } 2701 | } 2702 | layer { 2703 | name: "Scale173" 2704 | type: "Scale" 2705 | bottom: "BatchNorm173" 2706 | top: "643" 2707 | scale_param { 2708 | bias_term: true 2709 | } 2710 | } 2711 | layer { 2712 | name: "ReLU174" 2713 | type: "ReLU" 2714 | bottom: "643" 2715 | top: "644" 2716 | relu_param { 2717 | negative_slope: 0.1 2718 | } 2719 | } 2720 | layer { 2721 | name: "Convolution175" 2722 | type: "Convolution" 2723 | bottom: "644" 2724 | top: "646" 2725 | convolution_param { 2726 | num_output: 1024 2727 | bias_term: false 2728 | group: 1 2729 | pad_h: 1 2730 | pad_w: 1 2731 | kernel_h: 3 2732 | kernel_w: 3 2733 | stride_h: 1 2734 | stride_w: 1 2735 | 2736 | 2737 | } 2738 | } 2739 | layer { 2740 | name: "BatchNorm176" 2741 | type: "BatchNorm" 2742 | bottom: "646" 2743 | top: "BatchNorm176" 2744 | batch_norm_param { 2745 | use_global_stats: true 2746 | moving_average_fraction: 0.9 2747 | eps: 10e-06 2748 | } 2749 | } 2750 | layer { 2751 | name: "Scale176" 2752 | type: "Scale" 2753 | bottom: "BatchNorm176" 2754 | top: "648" 2755 | scale_param { 2756 | bias_term: true 2757 | } 2758 | } 2759 | layer { 2760 | name: "ReLU177" 2761 | type: "ReLU" 2762 | bottom: "648" 2763 | top: "649" 2764 | relu_param { 2765 | negative_slope: 0.1 2766 | } 2767 | } 2768 | layer { 2769 | name: "Eltwise178" 2770 | type: "Eltwise" 2771 | bottom: "649" 2772 | bottom: "639" 2773 | top: "650" 2774 | eltwise_param { 2775 | operation: SUM 2776 | coeff: 1 2777 | coeff: 1 2778 | } 2779 | } 2780 | layer { 2781 | name: "Convolution179" 2782 | type: "Convolution" 2783 | bottom: "650" 2784 | top: "652" 2785 | convolution_param { 2786 | num_output: 512 2787 | bias_term: false 2788 | group: 1 2789 | pad_h: 0 2790 | pad_w: 0 2791 | kernel_h: 1 2792 | kernel_w: 1 2793 | stride_h: 1 2794 | stride_w: 1 2795 | 2796 | 2797 | } 2798 | } 2799 | layer { 2800 | name: "BatchNorm180" 2801 | type: "BatchNorm" 2802 | bottom: "652" 2803 | top: "BatchNorm180" 2804 | batch_norm_param { 2805 | use_global_stats: true 2806 | moving_average_fraction: 0.9 2807 | eps: 10e-06 2808 | } 2809 | } 2810 | layer { 2811 | name: "Scale180" 2812 | type: "Scale" 2813 | bottom: "BatchNorm180" 2814 | top: "654" 2815 | scale_param { 2816 | bias_term: true 2817 | } 2818 | } 2819 | layer { 2820 | name: "ReLU181" 2821 | type: "ReLU" 2822 | bottom: "654" 2823 | top: "655" 2824 | relu_param { 2825 | negative_slope: 0.1 2826 | } 2827 | } 2828 | layer { 2829 | name: "Convolution182" 2830 | type: "Convolution" 2831 | bottom: "655" 2832 | top: "657" 2833 | convolution_param { 2834 | num_output: 1024 2835 | bias_term: false 2836 | group: 1 2837 | pad_h: 1 2838 | pad_w: 1 2839 | kernel_h: 3 2840 | kernel_w: 3 2841 | stride_h: 1 2842 | stride_w: 1 2843 | 2844 | 2845 | } 2846 | } 2847 | layer { 2848 | name: "BatchNorm183" 2849 | type: "BatchNorm" 2850 | bottom: "657" 2851 | top: "BatchNorm183" 2852 | batch_norm_param { 2853 | use_global_stats: true 2854 | moving_average_fraction: 0.9 2855 | eps: 10e-06 2856 | } 2857 | } 2858 | layer { 2859 | name: "Scale183" 2860 | type: "Scale" 2861 | bottom: "BatchNorm183" 2862 | top: "659" 2863 | scale_param { 2864 | bias_term: true 2865 | } 2866 | } 2867 | layer { 2868 | name: "ReLU184" 2869 | type: "ReLU" 2870 | bottom: "659" 2871 | top: "660" 2872 | relu_param { 2873 | negative_slope: 0.1 2874 | } 2875 | } 2876 | layer { 2877 | name: "Convolution185" 2878 | type: "Convolution" 2879 | bottom: "660" 2880 | top: "662" 2881 | convolution_param { 2882 | num_output: 512 2883 | bias_term: false 2884 | group: 1 2885 | pad_h: 0 2886 | pad_w: 0 2887 | kernel_h: 1 2888 | kernel_w: 1 2889 | stride_h: 1 2890 | stride_w: 1 2891 | 2892 | 2893 | } 2894 | } 2895 | layer { 2896 | name: "BatchNorm186" 2897 | type: "BatchNorm" 2898 | bottom: "662" 2899 | top: "BatchNorm186" 2900 | batch_norm_param { 2901 | use_global_stats: true 2902 | moving_average_fraction: 0.9 2903 | eps: 10e-06 2904 | } 2905 | } 2906 | layer { 2907 | name: "Scale186" 2908 | type: "Scale" 2909 | bottom: "BatchNorm186" 2910 | top: "664" 2911 | scale_param { 2912 | bias_term: true 2913 | } 2914 | } 2915 | layer { 2916 | name: "ReLU187" 2917 | type: "ReLU" 2918 | bottom: "664" 2919 | top: "665" 2920 | relu_param { 2921 | negative_slope: 0.1 2922 | } 2923 | } 2924 | layer { 2925 | name: "Convolution188" 2926 | type: "Convolution" 2927 | bottom: "665" 2928 | top: "667" 2929 | convolution_param { 2930 | num_output: 1024 2931 | bias_term: false 2932 | group: 1 2933 | pad_h: 1 2934 | pad_w: 1 2935 | kernel_h: 3 2936 | kernel_w: 3 2937 | stride_h: 1 2938 | stride_w: 1 2939 | 2940 | 2941 | } 2942 | } 2943 | layer { 2944 | name: "BatchNorm189" 2945 | type: "BatchNorm" 2946 | bottom: "667" 2947 | top: "BatchNorm189" 2948 | batch_norm_param { 2949 | use_global_stats: true 2950 | moving_average_fraction: 0.9 2951 | eps: 10e-06 2952 | } 2953 | } 2954 | layer { 2955 | name: "Scale189" 2956 | type: "Scale" 2957 | bottom: "BatchNorm189" 2958 | top: "669" 2959 | scale_param { 2960 | bias_term: true 2961 | } 2962 | } 2963 | layer { 2964 | name: "ReLU190" 2965 | type: "ReLU" 2966 | bottom: "669" 2967 | top: "670" 2968 | relu_param { 2969 | negative_slope: 0.1 2970 | } 2971 | } 2972 | layer { 2973 | name: "Convolution191" 2974 | type: "Convolution" 2975 | bottom: "670" 2976 | top: "672" 2977 | convolution_param { 2978 | num_output: 512 2979 | bias_term: false 2980 | group: 1 2981 | pad_h: 0 2982 | pad_w: 0 2983 | kernel_h: 1 2984 | kernel_w: 1 2985 | stride_h: 1 2986 | stride_w: 1 2987 | 2988 | 2989 | } 2990 | } 2991 | layer { 2992 | name: "BatchNorm192" 2993 | type: "BatchNorm" 2994 | bottom: "672" 2995 | top: "BatchNorm192" 2996 | batch_norm_param { 2997 | use_global_stats: true 2998 | moving_average_fraction: 0.9 2999 | eps: 10e-06 3000 | } 3001 | } 3002 | layer { 3003 | name: "Scale192" 3004 | type: "Scale" 3005 | bottom: "BatchNorm192" 3006 | top: "674" 3007 | scale_param { 3008 | bias_term: true 3009 | } 3010 | } 3011 | layer { 3012 | name: "ReLU193" 3013 | type: "ReLU" 3014 | bottom: "674" 3015 | top: "675" 3016 | relu_param { 3017 | negative_slope: 0.1 3018 | } 3019 | } 3020 | layer { 3021 | name: "Convolution199" 3022 | type: "Convolution" 3023 | bottom: "675" 3024 | top: "685" 3025 | convolution_param { 3026 | num_output: 256 3027 | bias_term: false 3028 | group: 1 3029 | pad_h: 0 3030 | pad_w: 0 3031 | kernel_h: 1 3032 | kernel_w: 1 3033 | stride_h: 1 3034 | stride_w: 1 3035 | 3036 | 3037 | } 3038 | } 3039 | layer { 3040 | name: "Convolution194" 3041 | type: "Convolution" 3042 | bottom: "675" 3043 | top: "677" 3044 | convolution_param { 3045 | num_output: 1024 3046 | bias_term: false 3047 | group: 1 3048 | pad_h: 1 3049 | pad_w: 1 3050 | kernel_h: 3 3051 | kernel_w: 3 3052 | stride_h: 1 3053 | stride_w: 1 3054 | 3055 | 3056 | } 3057 | } 3058 | layer { 3059 | name: "BatchNorm200" 3060 | type: "BatchNorm" 3061 | bottom: "685" 3062 | top: "BatchNorm200" 3063 | batch_norm_param { 3064 | use_global_stats: true 3065 | moving_average_fraction: 0.9 3066 | eps: 10e-06 3067 | } 3068 | } 3069 | layer { 3070 | name: "BatchNorm195" 3071 | type: "BatchNorm" 3072 | bottom: "677" 3073 | top: "BatchNorm195" 3074 | batch_norm_param { 3075 | use_global_stats: true 3076 | moving_average_fraction: 0.9 3077 | eps: 10e-06 3078 | } 3079 | } 3080 | layer { 3081 | name: "Scale200" 3082 | type: "Scale" 3083 | bottom: "BatchNorm200" 3084 | top: "687" 3085 | scale_param { 3086 | bias_term: true 3087 | } 3088 | } 3089 | layer { 3090 | name: "Scale195" 3091 | type: "Scale" 3092 | bottom: "BatchNorm195" 3093 | top: "679" 3094 | scale_param { 3095 | bias_term: true 3096 | } 3097 | } 3098 | layer { 3099 | name: "ReLU201" 3100 | type: "ReLU" 3101 | bottom: "687" 3102 | top: "688" 3103 | relu_param { 3104 | negative_slope: 0.1 3105 | } 3106 | } 3107 | layer { 3108 | name: "ReLU196" 3109 | type: "ReLU" 3110 | bottom: "679" 3111 | top: "680" 3112 | relu_param { 3113 | negative_slope: 0.1 3114 | } 3115 | } 3116 | layer { 3117 | name: "Interp202" 3118 | type: "Python" 3119 | bottom: "688" 3120 | top: "689" 3121 | python_param { 3122 | # the module name -- usually the filename -- that needs to be in $PYTHONPATH 3123 | module: 'interp' 3124 | # the layer name -- the class name in the module 3125 | layer: 'UpsamplingBilinear2d' 3126 | # the zoom factor 3127 | param_str: '{"zoom_factor":2}' 3128 | } 3129 | } 3130 | layer { 3131 | name: "Convolution197" 3132 | type: "Convolution" 3133 | bottom: "680" 3134 | top: "out0" 3135 | convolution_param { 3136 | num_output: 255 3137 | group: 1 3138 | pad_h: 0 3139 | pad_w: 0 3140 | kernel_h: 1 3141 | kernel_w: 1 3142 | stride_h: 1 3143 | stride_w: 1 3144 | 3145 | 3146 | } 3147 | } 3148 | layer { 3149 | name: "Concat203" 3150 | type: "Concat" 3151 | bottom: "689" 3152 | bottom: "601" 3153 | top: "690" 3154 | concat_param { 3155 | axis: 1 3156 | } 3157 | } 3158 | layer { 3159 | name: "Convolution204" 3160 | type: "Convolution" 3161 | bottom: "690" 3162 | top: "692" 3163 | convolution_param { 3164 | num_output: 256 3165 | bias_term: false 3166 | group: 1 3167 | pad_h: 0 3168 | pad_w: 0 3169 | kernel_h: 1 3170 | kernel_w: 1 3171 | stride_h: 1 3172 | stride_w: 1 3173 | 3174 | 3175 | } 3176 | } 3177 | layer { 3178 | name: "BatchNorm205" 3179 | type: "BatchNorm" 3180 | bottom: "692" 3181 | top: "BatchNorm205" 3182 | batch_norm_param { 3183 | use_global_stats: true 3184 | moving_average_fraction: 0.9 3185 | eps: 10e-06 3186 | } 3187 | } 3188 | layer { 3189 | name: "Scale205" 3190 | type: "Scale" 3191 | bottom: "BatchNorm205" 3192 | top: "694" 3193 | scale_param { 3194 | bias_term: true 3195 | } 3196 | } 3197 | layer { 3198 | name: "ReLU206" 3199 | type: "ReLU" 3200 | bottom: "694" 3201 | top: "695" 3202 | relu_param { 3203 | negative_slope: 0.1 3204 | } 3205 | } 3206 | layer { 3207 | name: "Convolution207" 3208 | type: "Convolution" 3209 | bottom: "695" 3210 | top: "697" 3211 | convolution_param { 3212 | num_output: 512 3213 | bias_term: false 3214 | group: 1 3215 | pad_h: 1 3216 | pad_w: 1 3217 | kernel_h: 3 3218 | kernel_w: 3 3219 | stride_h: 1 3220 | stride_w: 1 3221 | 3222 | 3223 | } 3224 | } 3225 | layer { 3226 | name: "BatchNorm208" 3227 | type: "BatchNorm" 3228 | bottom: "697" 3229 | top: "BatchNorm208" 3230 | batch_norm_param { 3231 | use_global_stats: true 3232 | moving_average_fraction: 0.9 3233 | eps: 10e-06 3234 | } 3235 | } 3236 | layer { 3237 | name: "Scale208" 3238 | type: "Scale" 3239 | bottom: "BatchNorm208" 3240 | top: "699" 3241 | scale_param { 3242 | bias_term: true 3243 | } 3244 | } 3245 | layer { 3246 | name: "ReLU209" 3247 | type: "ReLU" 3248 | bottom: "699" 3249 | top: "700" 3250 | relu_param { 3251 | negative_slope: 0.1 3252 | } 3253 | } 3254 | layer { 3255 | name: "Convolution210" 3256 | type: "Convolution" 3257 | bottom: "700" 3258 | top: "702" 3259 | convolution_param { 3260 | num_output: 256 3261 | bias_term: false 3262 | group: 1 3263 | pad_h: 0 3264 | pad_w: 0 3265 | kernel_h: 1 3266 | kernel_w: 1 3267 | stride_h: 1 3268 | stride_w: 1 3269 | 3270 | 3271 | } 3272 | } 3273 | layer { 3274 | name: "BatchNorm211" 3275 | type: "BatchNorm" 3276 | bottom: "702" 3277 | top: "BatchNorm211" 3278 | batch_norm_param { 3279 | use_global_stats: true 3280 | moving_average_fraction: 0.9 3281 | eps: 10e-06 3282 | } 3283 | } 3284 | layer { 3285 | name: "Scale211" 3286 | type: "Scale" 3287 | bottom: "BatchNorm211" 3288 | top: "704" 3289 | scale_param { 3290 | bias_term: true 3291 | } 3292 | } 3293 | layer { 3294 | name: "ReLU212" 3295 | type: "ReLU" 3296 | bottom: "704" 3297 | top: "705" 3298 | relu_param { 3299 | negative_slope: 0.1 3300 | } 3301 | } 3302 | layer { 3303 | name: "Convolution213" 3304 | type: "Convolution" 3305 | bottom: "705" 3306 | top: "707" 3307 | convolution_param { 3308 | num_output: 512 3309 | bias_term: false 3310 | group: 1 3311 | pad_h: 1 3312 | pad_w: 1 3313 | kernel_h: 3 3314 | kernel_w: 3 3315 | stride_h: 1 3316 | stride_w: 1 3317 | 3318 | 3319 | } 3320 | } 3321 | layer { 3322 | name: "BatchNorm214" 3323 | type: "BatchNorm" 3324 | bottom: "707" 3325 | top: "BatchNorm214" 3326 | batch_norm_param { 3327 | use_global_stats: true 3328 | moving_average_fraction: 0.9 3329 | eps: 10e-06 3330 | } 3331 | } 3332 | layer { 3333 | name: "Scale214" 3334 | type: "Scale" 3335 | bottom: "BatchNorm214" 3336 | top: "709" 3337 | scale_param { 3338 | bias_term: true 3339 | } 3340 | } 3341 | layer { 3342 | name: "ReLU215" 3343 | type: "ReLU" 3344 | bottom: "709" 3345 | top: "710" 3346 | relu_param { 3347 | negative_slope: 0.1 3348 | } 3349 | } 3350 | layer { 3351 | name: "Convolution216" 3352 | type: "Convolution" 3353 | bottom: "710" 3354 | top: "712" 3355 | convolution_param { 3356 | num_output: 256 3357 | bias_term: false 3358 | group: 1 3359 | pad_h: 0 3360 | pad_w: 0 3361 | kernel_h: 1 3362 | kernel_w: 1 3363 | stride_h: 1 3364 | stride_w: 1 3365 | 3366 | 3367 | } 3368 | } 3369 | layer { 3370 | name: "BatchNorm217" 3371 | type: "BatchNorm" 3372 | bottom: "712" 3373 | top: "BatchNorm217" 3374 | batch_norm_param { 3375 | use_global_stats: true 3376 | moving_average_fraction: 0.9 3377 | eps: 10e-06 3378 | } 3379 | } 3380 | layer { 3381 | name: "Scale217" 3382 | type: "Scale" 3383 | bottom: "BatchNorm217" 3384 | top: "714" 3385 | scale_param { 3386 | bias_term: true 3387 | } 3388 | } 3389 | layer { 3390 | name: "ReLU218" 3391 | type: "ReLU" 3392 | bottom: "714" 3393 | top: "715" 3394 | relu_param { 3395 | negative_slope: 0.1 3396 | } 3397 | } 3398 | layer { 3399 | name: "Convolution224" 3400 | type: "Convolution" 3401 | bottom: "715" 3402 | top: "725" 3403 | convolution_param { 3404 | num_output: 128 3405 | bias_term: false 3406 | group: 1 3407 | pad_h: 0 3408 | pad_w: 0 3409 | kernel_h: 1 3410 | kernel_w: 1 3411 | stride_h: 1 3412 | stride_w: 1 3413 | 3414 | 3415 | } 3416 | } 3417 | layer { 3418 | name: "Convolution219" 3419 | type: "Convolution" 3420 | bottom: "715" 3421 | top: "717" 3422 | convolution_param { 3423 | num_output: 512 3424 | bias_term: false 3425 | group: 1 3426 | pad_h: 1 3427 | pad_w: 1 3428 | kernel_h: 3 3429 | kernel_w: 3 3430 | stride_h: 1 3431 | stride_w: 1 3432 | 3433 | 3434 | } 3435 | } 3436 | layer { 3437 | name: "BatchNorm225" 3438 | type: "BatchNorm" 3439 | bottom: "725" 3440 | top: "BatchNorm225" 3441 | batch_norm_param { 3442 | use_global_stats: true 3443 | moving_average_fraction: 0.9 3444 | eps: 10e-06 3445 | } 3446 | } 3447 | layer { 3448 | name: "BatchNorm220" 3449 | type: "BatchNorm" 3450 | bottom: "717" 3451 | top: "BatchNorm220" 3452 | batch_norm_param { 3453 | use_global_stats: true 3454 | moving_average_fraction: 0.9 3455 | eps: 10e-06 3456 | } 3457 | } 3458 | layer { 3459 | name: "Scale225" 3460 | type: "Scale" 3461 | bottom: "BatchNorm225" 3462 | top: "727" 3463 | scale_param { 3464 | bias_term: true 3465 | } 3466 | } 3467 | layer { 3468 | name: "Scale220" 3469 | type: "Scale" 3470 | bottom: "BatchNorm220" 3471 | top: "719" 3472 | scale_param { 3473 | bias_term: true 3474 | } 3475 | } 3476 | layer { 3477 | name: "ReLU226" 3478 | type: "ReLU" 3479 | bottom: "727" 3480 | top: "728" 3481 | relu_param { 3482 | negative_slope: 0.1 3483 | } 3484 | } 3485 | layer { 3486 | name: "ReLU221" 3487 | type: "ReLU" 3488 | bottom: "719" 3489 | top: "720" 3490 | relu_param { 3491 | negative_slope: 0.1 3492 | } 3493 | } 3494 | layer { 3495 | name: "Interp227" 3496 | type: "Python" 3497 | bottom: "728" 3498 | top: "729" 3499 | python_param { 3500 | # the module name -- usually the filename -- that needs to be in $PYTHONPATH 3501 | module: 'interp' 3502 | # the layer name -- the class name in the module 3503 | layer: 'UpsamplingBilinear2d' 3504 | # the zoom factor 3505 | param_str: '{"zoom_factor":2}' 3506 | } 3507 | } 3508 | layer { 3509 | name: "Convolution222" 3510 | type: "Convolution" 3511 | bottom: "720" 3512 | top: "out1" 3513 | convolution_param { 3514 | num_output: 255 3515 | group: 1 3516 | pad_h: 0 3517 | pad_w: 0 3518 | kernel_h: 1 3519 | kernel_w: 1 3520 | stride_h: 1 3521 | stride_w: 1 3522 | 3523 | 3524 | } 3525 | } 3526 | layer { 3527 | name: "Concat228" 3528 | type: "Concat" 3529 | bottom: "729" 3530 | bottom: "508" 3531 | top: "730" 3532 | concat_param { 3533 | axis: 1 3534 | } 3535 | } 3536 | layer { 3537 | name: "Convolution229" 3538 | type: "Convolution" 3539 | bottom: "730" 3540 | top: "732" 3541 | convolution_param { 3542 | num_output: 128 3543 | bias_term: false 3544 | group: 1 3545 | pad_h: 0 3546 | pad_w: 0 3547 | kernel_h: 1 3548 | kernel_w: 1 3549 | stride_h: 1 3550 | stride_w: 1 3551 | 3552 | 3553 | } 3554 | } 3555 | layer { 3556 | name: "BatchNorm230" 3557 | type: "BatchNorm" 3558 | bottom: "732" 3559 | top: "BatchNorm230" 3560 | batch_norm_param { 3561 | use_global_stats: true 3562 | moving_average_fraction: 0.9 3563 | eps: 10e-06 3564 | } 3565 | } 3566 | layer { 3567 | name: "Scale230" 3568 | type: "Scale" 3569 | bottom: "BatchNorm230" 3570 | top: "734" 3571 | scale_param { 3572 | bias_term: true 3573 | } 3574 | } 3575 | layer { 3576 | name: "ReLU231" 3577 | type: "ReLU" 3578 | bottom: "734" 3579 | top: "735" 3580 | relu_param { 3581 | negative_slope: 0.1 3582 | } 3583 | } 3584 | layer { 3585 | name: "Convolution232" 3586 | type: "Convolution" 3587 | bottom: "735" 3588 | top: "737" 3589 | convolution_param { 3590 | num_output: 256 3591 | bias_term: false 3592 | group: 1 3593 | pad_h: 1 3594 | pad_w: 1 3595 | kernel_h: 3 3596 | kernel_w: 3 3597 | stride_h: 1 3598 | stride_w: 1 3599 | 3600 | 3601 | } 3602 | } 3603 | layer { 3604 | name: "BatchNorm233" 3605 | type: "BatchNorm" 3606 | bottom: "737" 3607 | top: "BatchNorm233" 3608 | batch_norm_param { 3609 | use_global_stats: true 3610 | moving_average_fraction: 0.9 3611 | eps: 10e-06 3612 | } 3613 | } 3614 | layer { 3615 | name: "Scale233" 3616 | type: "Scale" 3617 | bottom: "BatchNorm233" 3618 | top: "739" 3619 | scale_param { 3620 | bias_term: true 3621 | } 3622 | } 3623 | layer { 3624 | name: "ReLU234" 3625 | type: "ReLU" 3626 | bottom: "739" 3627 | top: "740" 3628 | relu_param { 3629 | negative_slope: 0.1 3630 | } 3631 | } 3632 | layer { 3633 | name: "Convolution235" 3634 | type: "Convolution" 3635 | bottom: "740" 3636 | top: "742" 3637 | convolution_param { 3638 | num_output: 128 3639 | bias_term: false 3640 | group: 1 3641 | pad_h: 0 3642 | pad_w: 0 3643 | kernel_h: 1 3644 | kernel_w: 1 3645 | stride_h: 1 3646 | stride_w: 1 3647 | 3648 | 3649 | } 3650 | } 3651 | layer { 3652 | name: "BatchNorm236" 3653 | type: "BatchNorm" 3654 | bottom: "742" 3655 | top: "BatchNorm236" 3656 | batch_norm_param { 3657 | use_global_stats: true 3658 | moving_average_fraction: 0.9 3659 | eps: 10e-06 3660 | } 3661 | } 3662 | layer { 3663 | name: "Scale236" 3664 | type: "Scale" 3665 | bottom: "BatchNorm236" 3666 | top: "744" 3667 | scale_param { 3668 | bias_term: true 3669 | } 3670 | } 3671 | layer { 3672 | name: "ReLU237" 3673 | type: "ReLU" 3674 | bottom: "744" 3675 | top: "745" 3676 | relu_param { 3677 | negative_slope: 0.1 3678 | } 3679 | } 3680 | layer { 3681 | name: "Convolution238" 3682 | type: "Convolution" 3683 | bottom: "745" 3684 | top: "747" 3685 | convolution_param { 3686 | num_output: 256 3687 | bias_term: false 3688 | group: 1 3689 | pad_h: 1 3690 | pad_w: 1 3691 | kernel_h: 3 3692 | kernel_w: 3 3693 | stride_h: 1 3694 | stride_w: 1 3695 | 3696 | 3697 | } 3698 | } 3699 | layer { 3700 | name: "BatchNorm239" 3701 | type: "BatchNorm" 3702 | bottom: "747" 3703 | top: "BatchNorm239" 3704 | batch_norm_param { 3705 | use_global_stats: true 3706 | moving_average_fraction: 0.9 3707 | eps: 10e-06 3708 | } 3709 | } 3710 | layer { 3711 | name: "Scale239" 3712 | type: "Scale" 3713 | bottom: "BatchNorm239" 3714 | top: "749" 3715 | scale_param { 3716 | bias_term: true 3717 | } 3718 | } 3719 | layer { 3720 | name: "ReLU240" 3721 | type: "ReLU" 3722 | bottom: "749" 3723 | top: "750" 3724 | relu_param { 3725 | negative_slope: 0.1 3726 | } 3727 | } 3728 | layer { 3729 | name: "Convolution241" 3730 | type: "Convolution" 3731 | bottom: "750" 3732 | top: "752" 3733 | convolution_param { 3734 | num_output: 128 3735 | bias_term: false 3736 | group: 1 3737 | pad_h: 0 3738 | pad_w: 0 3739 | kernel_h: 1 3740 | kernel_w: 1 3741 | stride_h: 1 3742 | stride_w: 1 3743 | 3744 | 3745 | } 3746 | } 3747 | layer { 3748 | name: "BatchNorm242" 3749 | type: "BatchNorm" 3750 | bottom: "752" 3751 | top: "BatchNorm242" 3752 | batch_norm_param { 3753 | use_global_stats: true 3754 | moving_average_fraction: 0.9 3755 | eps: 10e-06 3756 | } 3757 | } 3758 | layer { 3759 | name: "Scale242" 3760 | type: "Scale" 3761 | bottom: "BatchNorm242" 3762 | top: "754" 3763 | scale_param { 3764 | bias_term: true 3765 | } 3766 | } 3767 | layer { 3768 | name: "ReLU243" 3769 | type: "ReLU" 3770 | bottom: "754" 3771 | top: "755" 3772 | relu_param { 3773 | negative_slope: 0.1 3774 | } 3775 | } 3776 | layer { 3777 | name: "Convolution244" 3778 | type: "Convolution" 3779 | bottom: "755" 3780 | top: "757" 3781 | convolution_param { 3782 | num_output: 256 3783 | bias_term: false 3784 | group: 1 3785 | pad_h: 1 3786 | pad_w: 1 3787 | kernel_h: 3 3788 | kernel_w: 3 3789 | stride_h: 1 3790 | stride_w: 1 3791 | 3792 | 3793 | } 3794 | } 3795 | layer { 3796 | name: "BatchNorm245" 3797 | type: "BatchNorm" 3798 | bottom: "757" 3799 | top: "BatchNorm245" 3800 | batch_norm_param { 3801 | use_global_stats: true 3802 | moving_average_fraction: 0.9 3803 | eps: 10e-06 3804 | } 3805 | } 3806 | layer { 3807 | name: "Scale245" 3808 | type: "Scale" 3809 | bottom: "BatchNorm245" 3810 | top: "759" 3811 | scale_param { 3812 | bias_term: true 3813 | } 3814 | } 3815 | layer { 3816 | name: "ReLU246" 3817 | type: "ReLU" 3818 | bottom: "759" 3819 | top: "760" 3820 | relu_param { 3821 | negative_slope: 0.1 3822 | } 3823 | } 3824 | layer { 3825 | name: "Convolution247" 3826 | type: "Convolution" 3827 | bottom: "760" 3828 | top: "out2" 3829 | convolution_param { 3830 | num_output: 255 3831 | group: 1 3832 | pad_h: 0 3833 | pad_w: 0 3834 | kernel_h: 1 3835 | kernel_w: 1 3836 | stride_h: 1 3837 | stride_w: 1 3838 | 3839 | 3840 | } 3841 | } 3842 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | ### get the mapping from index to classname 5 | def get_classname_mapping(classfile): 6 | mapping = dict() 7 | with open(classfile, 'r') as fin: 8 | lines = fin.readlines() 9 | for ind, line in enumerate(lines): 10 | mapping[ind] = line.strip() 11 | return mapping 12 | 13 | ### Resize image with unchanged aspect ratio using padding 14 | def img_prepare(img, inp_dim): 15 | img_w, img_h = img.shape[1], img.shape[0] 16 | w, h = inp_dim 17 | new_w = int(img_w * min(w/img_w, h/img_h)) 18 | new_h = int(img_h * min(w/img_w, h/img_h)) 19 | resized_image = cv2.resize(img, (new_w,new_h), interpolation = cv2.INTER_CUBIC) 20 | 21 | canvas = np.full((inp_dim[1], inp_dim[0], 3), 128) 22 | 23 | canvas[(h-new_h)//2:(h-new_h)//2 + new_h,(w-new_w)//2:(w-new_w)//2 + new_w, :] = resized_image 24 | 25 | return canvas[:,:,::-1].transpose([2,0,1]) / 255.0 26 | 27 | ### Transform the logspace offset to linear space coordinates 28 | ### and rearrange the row-wise output 29 | def predict_transform(prediction, anchors, inp_dim=416, num_classes=80): 30 | batch_size = prediction.shape[0] 31 | stride = inp_dim // prediction.shape[2] 32 | grid_size = inp_dim // stride 33 | bbox_attrs = 5 + num_classes 34 | num_anchors = len(anchors) 35 | 36 | prediction = np.reshape(prediction, (batch_size, bbox_attrs*num_anchors, grid_size*grid_size)) 37 | prediction = np.swapaxes(prediction, 1, 2) 38 | prediction = np.reshape(prediction, (batch_size, grid_size*grid_size*num_anchors, bbox_attrs)) 39 | anchors = [(a[0]/stride, a[1]/stride) for a in anchors] 40 | 41 | #Sigmoid the centre_X, centre_Y. and object confidencce 42 | prediction[:,:,0] = 1 / (1 + np.exp(-prediction[:,:,0])) 43 | prediction[:,:,1] = 1 / (1 + np.exp(-prediction[:,:,1])) 44 | prediction[:,:,4] = 1 / (1 + np.exp(-prediction[:,:,4])) 45 | 46 | #Add the center offsets 47 | grid = np.arange(grid_size) 48 | a,b = np.meshgrid(grid, grid) 49 | 50 | x_offset = a.reshape(-1,1) 51 | y_offset = b.reshape(-1,1) 52 | 53 | x_y_offset = np.concatenate((x_offset, y_offset), 1) 54 | x_y_offset = np.tile(x_y_offset, (1, num_anchors)) 55 | x_y_offset = np.expand_dims(x_y_offset.reshape(-1,2), axis=0) 56 | 57 | prediction[:,:,:2] += x_y_offset 58 | 59 | #log space transform height, width and box corner point x-y 60 | anchors = np.tile(anchors, (grid_size*grid_size, 1)) 61 | anchors = np.expand_dims(anchors, axis=0) 62 | 63 | prediction[:,:,2:4] = np.exp(prediction[:,:,2:4])*anchors 64 | prediction[:,:,5: 5 + num_classes] = 1 / (1 + np.exp(-prediction[:,:, 5 : 5 + num_classes])) 65 | prediction[:,:,:4] *= stride 66 | 67 | box_corner = np.zeros(prediction.shape) 68 | box_corner[:,:,0] = (prediction[:,:,0] - prediction[:,:,2]/2) 69 | box_corner[:,:,1] = (prediction[:,:,1] - prediction[:,:,3]/2) 70 | box_corner[:,:,2] = (prediction[:,:,0] + prediction[:,:,2]/2) 71 | box_corner[:,:,3] = (prediction[:,:,1] + prediction[:,:,3]/2) 72 | prediction[:,:,:4] = box_corner[:,:,:4] 73 | 74 | return prediction 75 | 76 | ### Compute intersection of union score between bounding boxes 77 | def bbox_iou(bbox1, bbox2): 78 | #Get the coordinates of bounding boxes 79 | b1_x1, b1_y1, b1_x2, b1_y2 = bbox1[:,0], bbox1[:,1], bbox1[:,2], bbox1[:,3] 80 | b2_x1, b2_y1, b2_x2, b2_y2 = bbox2[:,0], bbox2[:,1], bbox2[:,2], bbox2[:,3] 81 | 82 | #get the corrdinates of the intersection rectangle 83 | inter_rect_x1 = np.maximum(b1_x1, b2_x1) 84 | inter_rect_y1 = np.maximum(b1_y1, b2_y1) 85 | inter_rect_x2 = np.minimum(b1_x2, b2_x2) 86 | inter_rect_y2 = np.minimum(b1_y2, b2_y2) 87 | 88 | #Intersection area 89 | inter_area = np.clip(inter_rect_x2 - inter_rect_x1 + 1, a_min=0, a_max=None) \ 90 | * np.clip(inter_rect_y2 - inter_rect_y1 + 1, a_min=0, a_max=None) 91 | 92 | #Union Area 93 | b1_area = (b1_x2 - b1_x1 + 1) * (b1_y2 - b1_y1 + 1) 94 | b2_area = (b2_x2 - b2_x1 + 1) * (b2_y2 - b2_y1 + 1) 95 | 96 | iou = inter_area / (b1_area + b2_area - inter_area) 97 | 98 | return iou 99 | 100 | ### Input: the model's output dict 101 | ### Output: list of tuples in ((cx1, cy1), (cx2, cy2), cls, prob) 102 | def rects_prepare(output, inp_dim=416, num_classes=80): 103 | prediction = None 104 | # transform prediction coordinates to correspond to pixel location 105 | for key, value in output.items(): 106 | # anchor sizes are borrowed from YOLOv3 config file 107 | if key == 'out0': 108 | anchors = [(116, 90), (156, 198), (373, 326)] 109 | elif key == 'out1': 110 | anchors = [(30, 61), (62, 45), (59, 119)] 111 | elif key == 'out2': 112 | anchors = [(10, 13), (16, 30), (33, 23)] 113 | if prediction is None: 114 | prediction = predict_transform(value, anchors=anchors) 115 | else: 116 | prediction = np.concatenate([prediction, predict_transform(value, anchors=anchors)], axis=1) 117 | 118 | # confidence thresholding 119 | confidence = 0.5 120 | conf_mask = np.expand_dims((prediction[:,:,4] > confidence), axis=2) 121 | prediction = prediction * conf_mask 122 | prediction = prediction[np.nonzero(prediction[:, :, 4])] 123 | 124 | # rearrange results 125 | img_result = np.zeros((prediction.shape[0], 6)) 126 | max_conf_cls = np.argmax(prediction[:, 5:5+num_classes], 1) 127 | #max_conf_score = np.amax(prediction[:, 5:5+num_classes], 1) 128 | 129 | img_result[:, :4] = prediction[:, :4] 130 | img_result[:, 4] = max_conf_cls 131 | img_result[:, 5] = prediction[:, 4] 132 | #img_result[:, 5] = max_conf_score 133 | 134 | # non-maxima suppression 135 | result = [] 136 | nms_threshold = 0.4 137 | 138 | img_result = img_result[img_result[:, 5].argsort()[::-1]] 139 | 140 | ind = 0 141 | while ind < img_result.shape[0]: 142 | bbox_cur = np.expand_dims(img_result[ind], 0) 143 | ious = bbox_iou(bbox_cur, img_result[(ind+1):]) 144 | nms_mask = np.expand_dims(ious < nms_threshold, axis=2) 145 | img_result[(ind+1):] = img_result[(ind+1):] * nms_mask 146 | img_result = img_result[np.nonzero(img_result[:, 5])] 147 | ind += 1 148 | 149 | for ind in range(img_result.shape[0]): 150 | pt1 = [int(img_result[ind, 0]), int(img_result[ind, 1])] 151 | pt2 = [int(img_result[ind, 2]), int(img_result[ind, 3])] 152 | cls, prob = int(img_result[ind, 4]), img_result[ind, 5] 153 | result.append((pt1, pt2, cls, prob)) 154 | 155 | return result 156 | 157 | ''' 158 | img_classes = np.unique(img_result[:, 4]) 159 | for cls in img_classes: 160 | # get predictions per class 161 | cls_mask = np.expand_dims((img_result[:, 4] == cls), axis=2) 162 | img_per_cls = img_result * cls_mask 163 | img_per_cls = img_per_cls[np.nonzero(img_per_cls[:, 5])] 164 | 165 | # descendingly sort the predictions by probability 166 | img_per_cls = img_per_cls[img_per_cls[:, 5].argsort()[::-1]] 167 | 168 | ind = 0 169 | while ind < img_per_cls.shape[0]: 170 | bbox_cur = np.expand_dims(img_per_cls[ind], 0) 171 | ious = bbox_iou(bbox_cur, img_per_cls[(ind+1):]) 172 | nms_mask = np.expand_dims(ious < nms_threshold, axis=2) 173 | img_per_cls[(ind+1):] = img_per_cls[(ind+1):] * nms_mask 174 | img_per_cls = img_per_cls[np.nonzero(img_per_cls[:, 5])] 175 | ind += 1 176 | 177 | for ind in range(img_per_cls.shape[0]): 178 | pt1 = [int(img_per_cls[ind, 0]), int(img_per_cls[ind, 1])] 179 | pt2 = [int(img_per_cls[ind, 2]), int(img_per_cls[ind, 3])] 180 | cls, prob = int(img_per_cls[ind, 4]), img_per_cls[ind, 5] 181 | result.append((pt1, pt2, cls, prob)) 182 | return result 183 | ''' 184 | 185 | --------------------------------------------------------------------------------