@@ -186,7 +210,8 @@ class ChineseOCRDBCRNN(hub.Module):
...
@@ -186,7 +210,8 @@ class ChineseOCRDBCRNN(hub.Module):
visualization=False,
visualization=False,
box_thresh=0.5,
box_thresh=0.5,
text_thresh=0.5,
text_thresh=0.5,
angle_classification_thresh=0.9):
angle_classification_thresh=0.9,
use_device=None):
"""
"""
Get the chinese texts in the predicted images.
Get the chinese texts in the predicted images.
Args:
Args:
...
@@ -199,18 +224,22 @@ class ChineseOCRDBCRNN(hub.Module):
...
@@ -199,18 +224,22 @@ class ChineseOCRDBCRNN(hub.Module):
box_thresh(float): the threshold of the detected text box's confidence
box_thresh(float): the threshold of the detected text box's confidence
text_thresh(float): the threshold of the chinese text recognition confidence
text_thresh(float): the threshold of the chinese text recognition confidence
angle_classification_thresh(float): the threshold of the angle classification confidence
angle_classification_thresh(float): the threshold of the angle classification confidence
use_device (str): use cpu, gpu, xpu or npu, overwrites use_gpu flag.
Returns:
Returns:
res (list): The result of chinese texts and save path of images.
res (list): The result of chinese texts and save path of images.
"""
"""
ifuse_gpu:
ifuse_deviceisnotNone:
try:
# check 'use_device' match 'device on init'
_places=os.environ["CUDA_VISIBLE_DEVICES"]
ifuse_device!=self.use_device:
int(_places[0])
except:
raiseRuntimeError(
raiseRuntimeError(
"Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id."
"the 'use_device' parameter when calling detect_text, does not match internal device found on init."
@@ -190,7 +214,8 @@ class ChineseOCRDBCRNNServer(hub.Module):
...
@@ -190,7 +214,8 @@ class ChineseOCRDBCRNNServer(hub.Module):
visualization=False,
visualization=False,
box_thresh=0.5,
box_thresh=0.5,
text_thresh=0.5,
text_thresh=0.5,
angle_classification_thresh=0.9):
angle_classification_thresh=0.9,
use_device=None):
"""
"""
Get the chinese texts in the predicted images.
Get the chinese texts in the predicted images.
Args:
Args:
...
@@ -203,18 +228,22 @@ class ChineseOCRDBCRNNServer(hub.Module):
...
@@ -203,18 +228,22 @@ class ChineseOCRDBCRNNServer(hub.Module):
box_thresh(float): the threshold of the detected text box's confidence
box_thresh(float): the threshold of the detected text box's confidence
text_thresh(float): the threshold of the chinese text recognition confidence
text_thresh(float): the threshold of the chinese text recognition confidence
angle_classification_thresh(float): the threshold of the angle classification confidence
angle_classification_thresh(float): the threshold of the angle classification confidence
use_device (str): use cpu, gpu, xpu or npu, overwrites use_gpu flag.
Returns:
Returns:
res (list): The result of chinese texts and save path of images.
res (list): The result of chinese texts and save path of images.
"""
"""
ifuse_gpu:
ifuse_deviceisnotNone:
try:
# check 'use_device' match 'device on init'
_places=os.environ["CUDA_VISIBLE_DEVICES"]
ifuse_device!=self.use_device:
int(_places[0])
except:
raiseRuntimeError(
raiseRuntimeError(
"Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id."
"the 'use_device' parameter when calling detect_text, does not match internal device found on init."
"Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id."
"the 'use_device' parameter when calling detect_text, does not match internal device found on init."
"Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id."
"the 'use_device' parameter when calling detect_text, does not match internal device found on init."