findCats.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:RaspberryPi-Robot 作者: timestocome 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号