padded_img=np.ones((new_h,new_w,3),dtype=np.uint8)*color# Scale ratio (new / old)r=min(new_h/shape[0],new_w/shape[1])# Compute paddingnew_unpad=int(round(shape[1]*r)),int(round(shape[0]*r))ifshape[::-1]!=new_unpad:im=cv2.resize(im,new_unpad,interpolation=cv2.INTER...