更新
This commit is contained in:
@@ -131,7 +131,15 @@ class NameReader:
|
||||
try:
|
||||
from rapidocr_onnxruntime import RapidOCR
|
||||
|
||||
self._engine = RapidOCR()
|
||||
try:
|
||||
# onnxruntime 默认按核数开满线程池且空转抢 CPU。识别的
|
||||
# 都是几十像素高的小裁片,两个线程绰绰有余;不限的话
|
||||
# 低配机每轮轮询都会被 OCR 抖一下。
|
||||
self._engine = RapidOCR(
|
||||
intra_op_num_threads=2, inter_op_num_threads=1
|
||||
)
|
||||
except Exception:
|
||||
self._engine = RapidOCR()
|
||||
except Exception as exc:
|
||||
self._engine_failed = True
|
||||
print(f" [身份] OCR 引擎不可用,无法读取会话昵称: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user