[:: + [:: + 'bgr'->'rgbx [::::- np clip( astype('uint 'return as we would be writing custom loss functions and manipulation routineswe would need to define certain placeholders keras is high-level library that utilizes tensor manipulation backends (like tensorflowtheanoand cntkto perform the heavy lifting thusthese placeholders provide high-level abstractions to work with the underlying tensor object the following snippet prepares placeholders for stylecontentand generated images along with the input tensor for the neural network in [ ]this is the path to the image you want to transform target_img 'data/city_road jpgthis is the path to the style image reference_style_img 'data/style pngwidthheight load_img(target_imgsize img_height img_width int(width img_height heighttarget_image constant(preprocess_image(target_imgheight=img_heightwidth=img_width)style_image constant(preprocess_image(reference_style_imgheight=img_heightwidth=img_width)placeholder for our generated image generated_image placeholder(( img_heightimg_width )combine the images into single batch input_tensor concatenate([target_imagestyle_imagegenerated_image]axis= we will load the pre-trained vgg- model as we did in the previous sectioni without the top fully connected layers the only difference here is that we would be providing the model constructorthe size dimensions of the input tensor the following snippet fetches the pretrained model in [ ]model vgg vgg (input_tensor=input_tensorweights='imagenet'include_top=falseyou may use the summary(function to understand the architecture of the pre-trained model