enhance-me / enhance_me /commons.py
geekyrakshit's picture
added dataloader
2673600
raw
history blame
252 Bytes
import tensorflow as tf
def read_image(image_path):
image = tf.io.read_file(image_path)
image = tf.image.decode_png(image, channels=3)
image.set_shape([None, None, 3])
image = tf.cast(image, dtype=tf.float32) / 255.0
return image