我为自己的课程重新启动了v3,并尝试在输入图像中本地化检测到的类。
基本上就像这个在图像中寻找行人的例子 http://silverpond.com.au/2016/10/24/pedestrian-detection-using-tensorflow-and-inception.html
所以我能够获得8x8x2048输出
with sess.as_default():
softmax_tensor = sess.graph.get_tensor_by_name('mixed_10/join:0')
predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0': cv2.imencode('.jpg', img)[1].tostring()})
print len(predictions)
for r in predictions:
print 'r',len(r)
for c in r:
print 'c',len(c)
print c
这给了我这样的输出:
1
r 8
c 8
[[ 1.47802579 0.45579425 0.32806152 ..., 0. 0. 0.315418 ]
[ 1.36758661 0.51684511 1.30546498 ..., 0. 0. 0.42971259]
[ 1.5746814 1.29075444 1.32023144 ..., 0. 0.23419005
0.11281317]
...,
如何将这些数字转换为我的类的预测?