2018-08-13 image data processng

2019-02-18  本文已影响4人  镜中无我

pretreatment

TFRecord

input data format
Example{Features{map<String,Feature{BytesList or FloatList or Int64List}>}}
write

image processing functions
image_raw_data=tf.gfile.FastGFile('image_path','r').read()
with tf.session() as sess:
       img_data=tf.image.decode_jpeg(image_raw_data)
       print(img_data.eval())
       plt.imshow(img_data.eval())
       plt.show()
       img_data=tf.image_convert_iamge_dtype(img_data,dtype=tf.float32)
#encode 

tf.image.resize_image_with_crop_or_pad(img_data, len_scale,wid_scale)
tf.image.central_crop(img_data,proportion)
tf.image.flip_up_down(...)#left_right
tf.image.transpose_image(image_data)
tf.image.random_flip_...

上一篇 下一篇

猜你喜欢

热点阅读