@handle_alpha
@torch.no_grad()
def predict(self, input_image, colormap=None):
    (h, w, d) = input_image.shape
    assert (d == 3), 'Input image must be RGB'
    torch.backends.cudnn.enabled = True
    torch.backends.cudnn.benchmark = True
    transform = self.get_transform()
    image_tensor = transform(input_image).to(self.device)
    prediction = self.model.forward(image_tensor)
    prediction = torch.nn.functional.interpolate(prediction.unsqueeze(1), size=(h, w), mode='bicubic', align_corners=False)
    disp = prediction.squeeze().cpu().numpy()
    disp /= disp.max()
    if colormap:
        out = apply_colormap(disp, colormap)
    else:
        out = to_rgb(disp)
    return (out * 255).astype(np.uint8)
@handle_alpha
@torch.no_grad()
def predict(self, input_image, colormap=None):
    (h, w, d) = input_image.shape
    assert (d == 3), 'Input image must be RGB'
    torch.backends.cudnn.enabled = True
    torch.backends.cudnn.benchmark = True
    transform = self.get_transform()
    image_tensor = transform(input_image).to(self.device)
    prediction = self.model.forward(image_tensor)
    prediction = torch.nn.functional.interpolate(prediction.unsqueeze(1), size=(h, w), mode='bicubic', align_corners=False)
    disp = prediction.squeeze().cpu().numpy()
    disp /= disp.max()
    if colormap:
        out = apply_colormap(disp, colormap)
    else:
        out = to_rgb(disp)
    return (out * 255).astype(np.uint8)