TensorFlow 图片读取
程序员文章站
2022-03-20 14:43:34
...
TensorFlow Version == 2.0.0
image_raw = tf.io.read_file('./img.jpg')
image = tf.image.decode_image(image_raw, channels=None, dtype=tf.dtypes.uint8)
print(image)
image_raw = tf.io.gfile.GFile('./img.jpg','rb').read()
image = tf.image.decode_image(image_raw)
print(image)