MCPcopy
hub / github.com/qqwweee/keras-yolo3 / yolo_body

Function yolo_body

yolo3/model.py:70–87  ·  view source on GitHub ↗

Create YOLO_V3 model CNN body in Keras.

(inputs, num_anchors, num_classes)

Source from the content-addressed store, hash-verified

68
69
70def 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
89def tiny_yolo_body(inputs, num_anchors, num_classes):
90 '''Create Tiny YOLO_v3 model CNN body in keras.'''

Callers 3

create_modelFunction · 0.90
generateMethod · 0.90
create_modelFunction · 0.90

Calls 4

composeFunction · 0.90
darknet_bodyFunction · 0.85
make_last_layersFunction · 0.85
DarknetConv2D_BN_LeakyFunction · 0.85

Tested by

no test coverage detected