def preprocess_input(image, net_h, net_w):
    new_h = 480
    new_w = 640
    if ((float(net_w) / new_w) < (float(net_h) / new_h)):
        new_h = ((new_h * net_w) / new_w)
        new_w = net_w
    else:
        new_w = ((new_w * net_h) / new_h)
        new_h = net_h
    resized = cv2.resize((image[:, :, ::(- 1)] / 255.0), (int(new_w), int(new_h)))
    new_image = (np.ones((net_h, net_w, 3)) * 0.5)
    new_image[int(((net_h - new_h) // 2)):int(((net_h + new_h) // 2)), int(((net_w - new_w) // 2)):int(((net_w + new_w) // 2)), :] = resized
    new_image = np.expand_dims(new_image, 0)
    return new_image
def preprocess_input(image, net_h, net_w):
    new_h = 480
    new_w = 640
    if ((float(net_w) / new_w) < (float(net_h) / new_h)):
        new_h = ((new_h * net_w) / new_w)
        new_w = net_w
    else:
        new_w = ((new_w * net_h) / new_h)
        new_h = net_h
    resized = cv2.resize((image[:, :, ::(- 1)] / 255.0), (int(new_w), int(new_h)))
    new_image = (np.ones((net_h, net_w, 3)) * 0.5)
    new_image[int(((net_h - new_h) // 2)):int(((net_h + new_h) // 2)), int(((net_w - new_w) // 2)):int(((net_w + new_w) // 2)), :] = resized
    new_image = np.expand_dims(new_image, 0)
    return new_image