(net, image, tile_size, scales, classes, flip_evaluation)
return full_probs
Predict an image by looking at it with different scales.
        We choose the "predict_whole_img" for the image with less than the original input size,
        for the input of larger size, we would choose the cropping method to ensure that GPU memory is enough.
Predict an image by looking at it with different scales.
        We choose the "predict_whole_img" for the image with less than the original input size,
        for the input of larger size, we would choose the cropping method to ensure that GPU memory is enough.
Predict an image by looking at it with different scales . We choose the predict_whole_img for the image with less than the original input size for the input of larger size we would choose the cropping method to ensure that GPU memory is enough .
def predict_multiscale(net, image, tile_size, scales, classes, flip_evaluation):
    """
    Predict an image by looking at it with different scales.
        We choose the "predict_whole_img" for the image with less than the original input size,
        for the input of larger size, we would choose the cropping method to ensure that GPU memory is enough.
    """
    image = image.data
    N_, C_, H_, W_ = image.shape
    full_probs = np.zeros((H_, W_, classes))
    for scale in scales:
        scale = float(scale)
        print("Predicting image scaled by %f" % scale)
        scale_image = ndimage.zoom(image, (1.0, 1.0, scale, scale), order=1, prefilter=False)
        scaled_probs = predict_whole(net, scale_image, tile_size)
        if flip_evaluation == True:
            flip_scaled_probs = predict_whole(net, scale_image[:, :, :, ::-1].copy(), tile_size)
            scaled_probs = 0.5 * (scaled_probs + flip_scaled_probs[:, ::-1, :])
        full_probs += scaled_probs
    full_probs /= len(scales)
    return full_probs
def predict_multiscale ( net , image , tile_size , scales , classes , flip_evaluation ) : image = image . data N_ , C_ , H_ , W_ = image . shape full_probs = np . zeros ( ( H_ , W_ , classes ) ) for scale in scales : scale = float ( scale ) print ( "Predicting image scaled by %f" % scale ) scale_image = ndimage . zoom ( image , ( 1.0 , 1.0 , scale , scale ) , order = 1 , prefilter = False ) scaled_probs = predict_whole ( net , scale_image , tile_size ) if flip_evaluation == True : flip_scaled_probs = predict_whole ( net , scale_image [ : , : , : , : : - 1 ] . copy ( ) , tile_size ) scaled_probs = 0.5 * ( scaled_probs + flip_scaled_probs [ : , : : - 1 , : ] ) full_probs += scaled_probs full_probs /= len ( scales ) return full_probs