未验证 提交 dbf35bb7 编写于 作者: Z zhoujun 提交者: GitHub

onnxruntime support gpu (#10668)

* Update ch_PP-OCRv3_rec.yml

* Update ch_PP-OCRv3_rec_distillation.yml

* Update en_PP-OCRv3_rec.yml

* Update arabic_PP-OCRv3_rec.yml

* Update chinese_cht_PP-OCRv3_rec.yml

* Update cyrillic_PP-OCRv3_rec.yml

* Update devanagari_PP-OCRv3_rec.yml

* Update japan_PP-OCRv3_rec.yml

* Update ka_PP-OCRv3_rec.yml

* Update korean_PP-OCRv3_rec.yml

* Update latin_PP-OCRv3_rec.yml

* Update ta_PP-OCRv3_rec.yml

* Update te_PP-OCRv3_rec.yml

* Update utility.py
上级 8f010ecf
......@@ -187,6 +187,9 @@ def create_predictor(args, mode, logger):
if not os.path.exists(model_file_path):
raise ValueError("not find model file path {}".format(
model_file_path))
if args.use_gpu:
sess = ort.InferenceSession(model_file_path, providers=['CUDAExecutionProvider'])
else:
sess = ort.InferenceSession(model_file_path)
return sess, sess.get_inputs()[0], None, None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册