Python 在使用Tensorflow对图像进行分类时,如何获得识别对象的像素矩阵?

Python 在使用Tensorflow对图像进行分类时,如何获得识别对象的像素矩阵?,python,tensorflow,deep-learning,object-recognition,Python,Tensorflow,Deep Learning,Object Recognition,我想在使用Tensorflow(classify_image.py)对图像进行分类时,得到图像中对象的像素矩阵 换句话说,必须首先对识别出的对象进行分割。 图片中有一台计算机,我想得到属于计算机的所有像素 但到目前为止,我还无法从Tensorflow的教程中找到一个示例 我唯一能得到的是通过Tensorflow示例代码得到的识别结果 e、 g 有人有主意吗?这可能吗?以下是使用TensorFlow进行图像分割的模型链接: softmax_tensor = sess.graph.get_

我想在使用Tensorflow(classify_image.py)对图像进行分类时,得到图像中对象的像素矩阵

换句话说,必须首先对识别出的对象进行分割。 图片中有一台计算机,我想得到属于计算机的所有像素

但到目前为止,我还无法从Tensorflow的教程中找到一个示例

我唯一能得到的是通过Tensorflow示例代码得到的识别结果

e、 g


有人有主意吗?这可能吗?

以下是使用TensorFlow进行图像分割的模型链接:

softmax_tensor = sess.graph.get_tensor_by_name('softmax:0')
predictions = sess.run(softmax_tensor,
                       {'DecodeJpeg/contents:0': image_data})
predictions = np.squeeze(predictions)

# Creates node ID --> English string lookup.
node_lookup = NodeLookup()

top_k = predictions.argsort()[-FLAGS.num_top_predictions:][::-1]
for node_id in top_k:
  human_string = node_lookup.id_to_string(node_id)
  score = predictions[node_id]
  print('%s (score = %.5f)' % (human_string, score))