Create YOLO_V3 model CNN body in Keras.
(inputs, num_anchors, num_classes)
| 68 | |
| 69 | |
| 70 | def yolo_body(inputs, num_anchors, num_classes): |
| 71 | """Create YOLO_V3 model CNN body in Keras.""" |
| 72 | darknet = Model(inputs, darknet_body(inputs)) |
| 73 | x, y1 = make_last_layers(darknet.output, 512, num_anchors*(num_classes+5)) |
| 74 | |
| 75 | x = compose( |
| 76 | DarknetConv2D_BN_Leaky(256, (1,1)), |
| 77 | UpSampling2D(2))(x) |
| 78 | x = Concatenate()([x,darknet.layers[152].output]) |
| 79 | x, y2 = make_last_layers(x, 256, num_anchors*(num_classes+5)) |
| 80 | |
| 81 | x = compose( |
| 82 | DarknetConv2D_BN_Leaky(128, (1,1)), |
| 83 | UpSampling2D(2))(x) |
| 84 | x = Concatenate()([x,darknet.layers[92].output]) |
| 85 | x, y3 = make_last_layers(x, 128, num_anchors*(num_classes+5)) |
| 86 | |
| 87 | return Model(inputs, [y1,y2,y3]) |
| 88 | |
| 89 | def tiny_yolo_body(inputs, num_anchors, num_classes): |
| 90 | '''Create Tiny YOLO_v3 model CNN body in keras.''' |
no test coverage detected