1. tf.gfile.LIstDirectory(filename)
返回文件夹(filename)的列表,类似于listdir,子文件夹只会返回文件夹名。
2. tf.image.decode_jpeg(jpeg_data,channels = depth)
jpeg_data = tf.placeholder(tf.string,name=''),将图片数据转化为tensor
3. tf.stack(values,axis = 0,name'stack')
组合为tensor,加一维
4. tf.cast(x,dtype)
转换tensor类型
5.tf.image.resize_bilinear(tensro_4d,resize_shape)
注意该函数必须是4维张量,可以通过expand_dims()和squeeze
6.tf.argmax(outputs,1)
返回最大索引
7. Tensor.eval(session = sess)
返回对应的np.array()
8. out_classes[prediction.eval(session = sess)]
花索引
本文介绍TensorFlow中常见的图像处理与文件操作方法,包括读取目录、解码JPEG图像、张量堆叠与类型转换、双线性插值缩放等。通过这些基本操作的学习,可以帮助开发者更好地进行图像数据预处理。
8811

被折叠的 条评论
为什么被折叠?



