predictions = np.squeeze(predictions)
answer = {}
for node_id in range(len(predictions)):
answer[self.labels[node_id]] = predictions[node_id]
answers.append(answer)
return answers
@staticmethod
After Change
def detect_multiple(self, images):
image_array_list = [self._pil_to_tf(image) for image in images]
pool = ThreadPool()
with tf.device("/gpu:0"):
softmax_tensor = self.sess.graph.get_tensor_by_name("final_result:0")
threads = [pool.apply_async(operation, args=(self.sess, softmax_tensor, image_array_list[i],)) for i in