Understanding the output shape of the following YOLO network Below you can see a convolutional network with 24 convolutional layers. I am trying to understand the shape of the network. Given the input image with shape 448x448x3, we apply first conv filter of shape 7x7x64 with stride = 2 followed by a maxpool layer with 2x2 with stride 2. The output as I calculated it is as follows:
$$
o_{conv}=\frac{448-7}{2}+1=221
\\
o_{pool}=\frac{221-2}{2}+1=110.5
$$
I am not sure why we got the shape to be 112, please.


I couldn't find YoloV1 TFlite model file and verify, but the option that can cause this is padding. There are two modes of padding: SAME and VALID. In the SAME option, the input image is padded from left/right and top/bottom such that the output will be of the same size (when strides are 1). For that, you need 6 pixels of padding. And, with stride equal to 2, you'll have
$$o_{\text{conv}}=\bigg\lfloor{\frac{448-7+6}{2}}\bigg\rfloor+1=224$$
When we pool this with $2\times 2$ filters, we get $112$ pixels.
