def run_graph(self):
# take photo
t = self.capture_image()
# see if Min, Merlin or no cat in photo
input_operation = self.graph.get_operation_by_name(self.input_layer_name);
output_operation = self.graph.get_operation_by_name(self.output_layer_name);
results = self.sess.run(output_operation.outputs[0], {input_operation.outputs[0]: t})
results = np.squeeze(results)
top_k = results.argsort()[-3:][::-1]
# print results
#for i in top_k:
# print(self.labels[i], results[i])
found = []
for i in top_k:
found.append((self.labels[i], results[i]))
return found
评论列表
文章目录