From 0e1cb1814fe6d15fe00a3cc715e055d86c3f03cc Mon Sep 17 00:00:00 2001 From: SWHL Date: Thu, 16 May 2024 22:17:21 +0800 Subject: [PATCH] chore(rapidocr_onnxruntime): Add friendly tips for using cuda --- python/rapidocr_onnxruntime/utils.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/python/rapidocr_onnxruntime/utils.py b/python/rapidocr_onnxruntime/utils.py index a7958c3..aad76b6 100644 --- a/python/rapidocr_onnxruntime/utils.py +++ b/python/rapidocr_onnxruntime/utils.py @@ -307,7 +307,12 @@ def init_args(): global_group.add_argument("--inter_op_num_threads", type=int, default=-1) det_group = parser.add_argument_group(title="Det") - det_group.add_argument("--det_use_cuda", action="store_true", default=False) + det_group.add_argument( + "--det_use_cuda", + action="store_true", + default=False, + help="Whether to use cuda. The prerequisite is: first uninstall all onnxruntime packages and install only the onnxruntime-gpu library.", + ) det_group.add_argument( "--det_use_dml", action="store_true", @@ -330,7 +335,12 @@ def init_args(): ) cls_group = parser.add_argument_group(title="Cls") - cls_group.add_argument("--cls_use_cuda", action="store_true", default=False) + cls_group.add_argument( + "--cls_use_cuda", + action="store_true", + default=False, + help="Whether to use cuda. The prerequisite is: first uninstall all onnxruntime packages and install only the onnxruntime-gpu library.", + ) cls_group.add_argument( "--cls_use_dml", action="store_true", @@ -344,7 +354,12 @@ def init_args(): cls_group.add_argument("--cls_thresh", type=float, default=0.9) rec_group = parser.add_argument_group(title="Rec") - rec_group.add_argument("--rec_use_cuda", action="store_true", default=False) + rec_group.add_argument( + "--rec_use_cuda", + action="store_true", + default=False, + help="Whether to use cuda. The prerequisite is: first uninstall all onnxruntime packages and install only the onnxruntime-gpu library.", + ) rec_group.add_argument( "--rec_use_dml", action="store_true",