提交 b2dbbc3c 编写于 作者: L lubin10

fix predict_det.py error

上级 8276dccd
...@@ -109,17 +109,16 @@ class DetPredictor(Predictor): ...@@ -109,17 +109,16 @@ class DetPredictor(Predictor):
''' '''
inputs = self.preprocess(image) inputs = self.preprocess(image)
np_boxes = None np_boxes = None
input_names = self.paddle_predictor.get_input_names() input_names = self.predictor.get_input_names()
for i in range(len(input_names)): for i in range(len(input_names)):
input_tensor = self.paddle_predictor.get_input_handle(input_names[ input_tensor = self.predictor.get_input_handle(input_names[i])
i])
input_tensor.copy_from_cpu(inputs[input_names[i]]) input_tensor.copy_from_cpu(inputs[input_names[i]])
t1 = time.time() t1 = time.time()
self.paddle_predictor.run() self.predictor.run()
output_names = self.paddle_predictor.get_output_names() output_names = self.predictor.get_output_names()
boxes_tensor = self.paddle_predictor.get_output_handle(output_names[0]) boxes_tensor = self.predictor.get_output_handle(output_names[0])
np_boxes = boxes_tensor.copy_to_cpu() np_boxes = boxes_tensor.copy_to_cpu()
t2 = time.time() t2 = time.time()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册