mirror of
https://github.com/wess09/AzurLaneAutoScript.git
synced 2026-05-14 01:18:15 +08:00
fix
This commit is contained in:
parent
73123f9027
commit
b95ef734ef
@ -7,19 +7,27 @@ import cv2
|
||||
from rich.table import Table
|
||||
from rich.text import Text
|
||||
|
||||
from module.daemon.daemon_base import DaemonBase
|
||||
from module.config.config import AzurLaneConfig
|
||||
from module.exception import RequestHumanTakeover
|
||||
from module.logger import logger
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
|
||||
|
||||
class OcrBenchmark(DaemonBase):
|
||||
class OcrBenchmark:
|
||||
# Each entry: (model_name, dataset_prefix, subfolder_name)
|
||||
BENCHMARKS = [
|
||||
('en', 'sets_num', 'sets_num'),
|
||||
('cn', 'sets_zhcn', 'sets_zhcn'),
|
||||
]
|
||||
|
||||
def __init__(self, config, device=None, task=None):
|
||||
if isinstance(config, AzurLaneConfig):
|
||||
self.config = config
|
||||
if task is not None:
|
||||
self.config.init_task(task)
|
||||
else:
|
||||
self.config = AzurLaneConfig(config, task=task)
|
||||
|
||||
def _find_archive(self, prefix):
|
||||
for ext in ['.zip', '.tar', '.tar.xz', '.tar.gz']:
|
||||
path = f'module/daemon/{prefix}{ext}'
|
||||
|
||||
@ -111,7 +111,7 @@ class RecOnlyOCR(RapidOCR):
|
||||
self.use_rec = cfg.Global.use_rec
|
||||
cfg.Rec.engine_cfg = cfg.EngineConfig[cfg.Rec.engine_type.value]
|
||||
cfg.Rec.font_path = cfg.Global.font_path
|
||||
cfg.Rec.model_root_dir = cfg.Global.model_root_dir
|
||||
cfg.Rec.model_root_dir = cfg.Global.get("model_root_dir", os.getcwd())
|
||||
self.text_rec = TextRecognizer(cfg.Rec)
|
||||
|
||||
self.load_img = LoadImage()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user