YOLO_v3_tutorial_from_scratch
YOLO_v3_tutorial_from_scratch copied to clipboard
what does "pad = (kernel_size - 1) // 2" mean?
darknet.py line 94 still don't get it, I googled a lot, at yolov3.cfg where padding always equal to 1, some say padding is constant( links), and i tried padding = 1 in every loop, end up with error, so I use the original code from darknet.py in this repository, it works, but how "pad = (kernel_size - 1) // 2" ? why?
if padding:
pad = (kernel_size -1) // 2
else:
pad = 0
As a beginner, I think pad in yolov3.cfg means whether to use padding. In yolo, only stride controls the output size. If stride = 1, output the same size as input, you must use pad = (kernel_size - 1) // 2.(called Same Convolution). If stride = 2, pad = (kernel_size - 1) // 2, output half size.