def is_cat(self):
now = datetime.datetime.now()
# 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)
found = []
for i in range(3):
found.append((self.labels[i], results[i]))
print(datetime.datetime.now() - now)
return found
评论列表
文章目录