A series of resblocks starting with a downsampling Convolution2D
(x, num_filters, num_blocks)
| 32 | LeakyReLU(alpha=0.1)) |
| 33 | |
| 34 | def resblock_body(x, num_filters, num_blocks): |
| 35 | '''A series of resblocks starting with a downsampling Convolution2D''' |
| 36 | # Darknet uses left and top padding instead of 'same' mode |
| 37 | x = ZeroPadding2D(((1,0),(1,0)))(x) |
| 38 | x = DarknetConv2D_BN_Leaky(num_filters, (3,3), strides=(2,2))(x) |
| 39 | for i in range(num_blocks): |
| 40 | y = compose( |
| 41 | DarknetConv2D_BN_Leaky(num_filters//2, (1,1)), |
| 42 | DarknetConv2D_BN_Leaky(num_filters, (3,3)))(x) |
| 43 | x = Add()([x,y]) |
| 44 | return x |
| 45 | |
| 46 | def darknet_body(x): |
| 47 | '''Darknent body having 52 Convolution2D layers''' |
no test coverage detected