Fix logic error

This commit is contained in:
SWHL committed 2022-06-30 22:08:54 +08:00
1 parent 5bd6050ff3
commit d86a6803ee
4 files changed
-13

No files matched your search

@@ -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'],
@@ -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'],
@@ -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
@@ -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