Skip to content

Instantly share code, notes, and snippets.

@shayaf84
Created November 19, 2021 23:30
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 shayaf84/ac1a85c20715e7ce30b3c83a06238b1d to your computer and use it in GitHub Desktop.
Save shayaf84/ac1a85c20715e7ce30b3c83a06238b1d to your computer and use it in GitHub Desktop.
interp1.py
from tensorflow import io
#Convert image to a tensor - 3 RGB Channels - resized to 224x224
image = tf.io.read_file("drive/MyDrive/oboe.png")
image = tf.io.decode_jpeg(image, channels=3)
image = tf.image.convert_image_dtype(image, tf.float32)
image = tf.image.resize_with_pad(image, target_height=224, target_width=224)
#Generates 50 intervals for the interpolation of images
alpha = tf.linspace(start=0.0, stop=1.0, num= 50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment