提交 5bb6ae05 编写于 作者: L LDOUBLEV

add rec get_gpu_id

上级 d83b1de1
...@@ -68,6 +68,7 @@ class TextRecognizer(object): ...@@ -68,6 +68,7 @@ class TextRecognizer(object):
if args.benchmark: if args.benchmark:
import auto_log import auto_log
pid = os.getpid() pid = os.getpid()
gpu_id = utility.get_infer_gpuid()
self.autolog = auto_log.AutoLogger( self.autolog = auto_log.AutoLogger(
model_name="rec", model_name="rec",
model_precision=args.precision, model_precision=args.precision,
...@@ -77,7 +78,7 @@ class TextRecognizer(object): ...@@ -77,7 +78,7 @@ class TextRecognizer(object):
inference_config=self.config, inference_config=self.config,
pids=pid, pids=pid,
process_name=None, process_name=None,
gpu_ids=0 if args.use_gpu else None, gpu_ids=gpu_id if args.use_gpu else None,
time_keys=[ time_keys=[
'preprocess_time', 'inference_time', 'postprocess_time' 'preprocess_time', 'inference_time', 'postprocess_time'
], ],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册