Technology-OpenCV 转 Tensorflow 格式 发表于 2018-07-10 | 分类于 Technology | | OpenCV 转 Tensorflow 图片格式。 12345image_data = tf.gfile.FastGFile(image_path, 'rb').read()predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0':image_data})image_data = cv2.imread(image_path)predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0': cv2.imencode('.jpg', image_data)[1].tostring()})