Skip to content

Instantly share code, notes, and snippets.

@Yuvnish017
Created June 24, 2021 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuvnish017/1e2cb0c4605e80a9d191063a3d9d6d4f to your computer and use it in GitHub Desktop.
Save Yuvnish017/1e2cb0c4605e80a9d191063a3d9d6d4f to your computer and use it in GitHub Desktop.
img = cv2.imread('yuvnish_malhotra_photo.jpg')
print(img.shape)
(height, width, channels) = img.shape
img_rows = 400
img_cols = int(width * img_rows / height)
result_prefix = "neural_style_transfer_generated"
# Weights of the different loss components
total_variation_weight = 1e-6
style_weight = 5e-6
content_weight = 1e-8
figure = plt.figure(figsize=(10, 10))
style_img = cv2.imread('style_image3.jpg')
style_img = cv2.cvtColor(style_img, cv2.COLOR_BGR2RGB)
plt.imshow(style_img)
plt.axis('off')
plt.title('Style Image')
figure2 = plt.figure(figsize=(10, 10))
content_img = cv2.imread('yuvnish malhotra photo.jpg')
content_img = cv2.cvtColor(content_img, cv2.COLOR_BGR2RGB)
plt.imshow(content_img)
plt.axis('off')
plt.title('Content Image')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment