π Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.
Fix logic error
SWHLd86a6803ee92
diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/utils.py b/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/utils.pyindex 55b4816..8ee0fa5 100644--- a/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/utils.py+++ b/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/utils.py@@ -31,9 +31,6 @@ class OrtInferSession(object):if config['use_cuda'] and get_device() == 'GPU' \and cuda_ep in get_available_providers():EP_list = [(cuda_ep, config[cuda_ep])]- else:- raise RuntimeError(f'{cuda_ep} is not avaiable for --use_cuda!')-EP_list.append(cpu_ep)self.session = InferenceSession(config['model_path'],diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v2_det/utils.py b/python/rapidocr_onnxruntime/ch_ppocr_v2_det/utils.pyindex e743908..674ed8b 100644--- a/python/rapidocr_onnxruntime/ch_ppocr_v2_det/utils.py+++ b/python/rapidocr_onnxruntime/ch_ppocr_v2_det/utils.py@@ -42,9 +42,6 @@ class OrtInferSession(object):if config['use_cuda'] and get_device() == 'GPU' \and cuda_ep in get_available_providers():EP_list = [(cuda_ep, config[cuda_ep])]- else:- raise RuntimeError(f'{cuda_ep} is not avaiable for --use_cuda!')-EP_list.append(cpu_ep)self.session = InferenceSession(config['model_path'],diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v2_rec/utils.py b/python/rapidocr_onnxruntime/ch_ppocr_v2_rec/utils.pyindex 489a04d..a0dbf8d 100644--- a/python/rapidocr_onnxruntime/ch_ppocr_v2_rec/utils.py+++ b/python/rapidocr_onnxruntime/ch_ppocr_v2_rec/utils.py@@ -22,8 +22,6 @@ class OrtInferSession(object):if config['use_cuda'] and get_device() == 'GPU' \and cuda_ep in get_available_providers():EP_list = [(cuda_ep, config[cuda_ep])]- else:- raise RuntimeError(f'{cuda_ep} is not avaiable for --use_cuda!')EP_list.append(cpu_ep)@@ -116,4 +114,3 @@ class CTCLabelDecode(object):text = ''.join(char_list)result_list.append((text, np.mean(conf_list)))return result_list-diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/utils.py b/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/utils.pyindex e50bc2a..9e0d436 100644--- a/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/utils.py+++ b/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/utils.py@@ -22,9 +22,6 @@ class OrtInferSession(object):if config['use_cuda'] and get_device() == 'GPU' \and cuda_ep in get_available_providers():EP_list = [(cuda_ep, config[cuda_ep])]- else:- raise RuntimeError(f'{cuda_ep} is not avaiable for --use_cuda!')-EP_list.append(cpu_ep)self.session = InferenceSession(config['model_path'],@@ -116,4 +113,3 @@ class CTCLabelDecode(object):text = ''.join(char_list)result_list.append((text, np.mean(conf_list)))return result_list-