Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tf_image = tf.io.decode_image(image, channels=3)
- tf_image = tf.compat.v1.image.resize_image_with_pad(tf_image, 256, 512)
- out = tf.cast(tf_image, tf.uint8)
- out = tf.image.encode_jpeg(out, format="rgb", quality=100)
- # out = tf.io.write_file("test.jpeg", out)
- with tf.Session() as sess:
- jpeg_byte = sess.run(out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement