def load_vgg(self): self.vgg = load_vgg.VGG(self.input_img) self.vgg.load() # mean-center self.content_img -= self.vgg.mean_pixels self.style_img -= self.vgg.mean_pixels
def load_vgg(self): """ 加载vgg模型并对图片进行预处理 """ self.vgg = load_vgg.VGG(self.input_img) self.vgg.load() # mean-center self.content_img -= self.vgg.mean_pixels self.style_img -= self.vgg.mean_pixels
def load_vgg(self): """ load vgg model to preprocess photos """ self.vgg = load_vgg.VGG(self.input_photo) self.vgg.load() # mean-center self.content_photo -= self.vgg.mean_pixels self.style_photo -= self.vgg.mean_pixels
def load_vgg(self): ''' Load the saved model parameters of VGG-19, using the input_img as the input to compute the output at each layer of vgg. During training, VGG-19 mean-centered all images and found the mean pixels to be [123.68, 116.779, 103.939] along RGB dimensions. We have to subtract this mean from our images. ''' self.vgg = load_vgg.VGG(self.input_img) self.vgg.load() self.content_img -= self.vgg.mean_pixels self.style_img -= self.vgg.mean_pixels