tensorflow 的reshape()和resize()函数
来源:互联网 发布:js调用手写输入法 编辑:程序博客网 时间:2024/06/05 01:11
如果Linux上没有安装opencv即import cv2报错,
image=cv2.resize(image,(76,76)).reshape((1,76,76,3))
以上语句可以由PIL中的函数代替,语句如下:
#coding=utf-8import tensorflow as tfimport osimport numpy as npfrom PIL import Imagedef test(data_root='/home/system/Python/DData'): image_filenames = os.listdir(data_root) image_filenames = [(data_root + '/' + i) for i in image_filenames] print "kkk" with tf.Session() as session: coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord) for img in image_filenames: print img image = Image.open(img) new_img = image.resize((76,76)) new_img=np.array(new_img) new_imgg=new_img.reshape([1,76,76,3]) print "cv shape:", image coord.request_stop() # queue需要关闭,否则报错 coord.join(threads)test('/home/system/Python/DData')
阅读全文
0 0
- tensorflow 的reshape()和resize()函数
- OpenCV中的Resize函数和Reshape函数
- Tensorflow里的reshape函数
- Resize和Reshape-opencv
- OpenCV中的Resize和Reshape
- OpenCV中的Resize和Reshape
- opencv中的reshape和resize
- OpenCV中的Resize和Reshape
- Tensorflow中reshape()函数的使用
- 【Tensorflow】tf.reshape 函数
- tensorflow tenosr的操作 concat 和 reshape
- Tensorflow深度学习之十六:placeholder的注解和reshape函数
- OpenCV中的Resize和Reshape不同
- TensorFlow的reshape操作 tf.reshape
- TensorFlow的reshape操作 tf.reshape
- TensorFlow的reshape操作 tf.reshape
- TensorFlow的reshape操作 tf.reshape
- tensorflow的reshape操作tf.reshape()
- HDU 4135 Co-prime (容斥原理)
- 3种Java从文件路径中获取文件名的方法
- swiper-移动端网页触摸内容滑动js插件
- 51Nod 1174区间中最大的数
- 光耦型号内部结构图
- tensorflow 的reshape()和resize()函数
- Python post 传递text格式参数(自己组装数据头)
- 2.自动索引计算数组元素的平方和
- Opencv实现的简易绘图工具
- ORA-02290: 违反检查约束条件 (MES_V1.SYS_C0027075)原因以及解决方法
- 面面向对象(上) 封装,继承,对象初始化流程,单例设计模式向对象(上) 封装,继承,对象初始化流程,单例设计模式
- BIO与NIO、AIO的区别
- 开关电源上的光耦的故障检修
- scrollWidth,clientWidth,offsetWidth的区别 通过一个demo测试这三个属性的差别。 说明: scrollWidth:对象的实际内容的宽度,不包边线宽度,会随对象