|
|
@ -679,8 +679,8 @@ def letterbox(img, new_shape=(640, 640), color=(114, 114, 114), auto=True, scale
|
|
|
|
dw, dh = np.mod(dw, 64), np.mod(dh, 64) # wh padding
|
|
|
|
dw, dh = np.mod(dw, 64), np.mod(dh, 64) # wh padding
|
|
|
|
elif scaleFill: # stretch
|
|
|
|
elif scaleFill: # stretch
|
|
|
|
dw, dh = 0.0, 0.0
|
|
|
|
dw, dh = 0.0, 0.0
|
|
|
|
new_unpad = new_shape
|
|
|
|
new_unpad = (new_shape[1], new_shape[0])
|
|
|
|
ratio = new_shape[0] / shape[1], new_shape[1] / shape[0] # width, height ratios
|
|
|
|
ratio = new_shape[1] / shape[1], new_shape[0] / shape[0] # width, height ratios
|
|
|
|
|
|
|
|
|
|
|
|
dw /= 2 # divide padding into 2 sides
|
|
|
|
dw /= 2 # divide padding into 2 sides
|
|
|
|
dh /= 2
|
|
|
|
dh /= 2
|
|
|
|