mind not support alg
@@ -38,6 +38,7 @@ class TextE2E(object):
def __init__(self, args):
self.args = args
self.e2e_algorithm = args.e2e_algorithm
+ self.use_onnx = args.use_onnx
pre_process_list = [{
'E2EResizeForTest': {}
}, {
@@ -106,6 +107,16 @@ class TextE2E(object):
img = img.copy()
starttime = time.time()
+ if self.use_onnx:
+ input_dict = {}
+ input_dict[self.input_tensor.name] = img
+ outputs = self.predictor.run(self.output_tensors, input_dict)
+ preds = {}
+ preds['f_border'] = outputs[0]
+ preds['f_char'] = outputs[1]
+ preds['f_direction'] = outputs[2]
+ preds['f_score'] = outputs[3]
+ else:
self.input_tensor.copy_from_cpu(img)
self.predictor.run()
outputs = []
