keras_vgg_buddy/models.py
def img_from_vgg(x):
    '''Decondition an image from the VGG16 model.'''
    x = x.transpose((1, 2, 0))
    x[:, :, 0] += 103.939
    x[:, :, 1] += 116.779
    x[:, :, 2] += 123.68
    x = x[:,:,::-1]  # to RGB
    return x
def img_from_vgg(x):
    '''Decondition an image from the VGG16 model.'''
    x = x.transpose((1, 2, 0))
    x[:, :, 0] += 103.939
    x[:, :, 1] += 116.779
    x[:, :, 2] += 123.68
    x = x[:,:,::-1]  # to RGB
    return x
def img_from_vgg ( x ) : x = x . transpose ( ( 1 , 2 , 0 ) ) x [ : , : , 0 ] += 103.939 x [ : , : , 1 ] += 116.779 x [ : , : , 2 ] += 123.68 x = x [ : , : , : : - 1 ] # to RGB return x
Decondition an image from the VGG16 model.
Decondition an image from the VGG16 model .