mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 03:58:22 +08:00
Opt: No mxnet loading at first release_resources() for faster startup
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from module.base.decorator import cached_property
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
|
||||
|
||||
class OcrModel:
|
||||
@@ -13,8 +12,9 @@ class OcrModel:
|
||||
# Font: Impact, AgencyFB-Regular, MStiffHeiHK-UltraBold
|
||||
# Charset: 0123456789ABCDEFGHIJKLMNPQRSTUVWXYZ:/- (Letter 'O' and <space> is not included)
|
||||
# _num_classes: 39
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
return AlOcr(model_name='densenet-lite-gru', model_epoch=15, root='./bin/cnocr_models/azur_lane',
|
||||
name='azur_lane')
|
||||
name='azur_lane')
|
||||
|
||||
@cached_property
|
||||
def cnocr(self):
|
||||
@@ -26,10 +26,12 @@ class OcrModel:
|
||||
# Font: Various
|
||||
# Charset: Number, English character, Chinese character, symbols, <space>
|
||||
# _num_classes: 6426
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
return AlOcr(model_name='densenet-lite-gru', model_epoch=39, root='./bin/cnocr_models/cnocr', name='cnocr')
|
||||
|
||||
@cached_property
|
||||
def jp(self):
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
return AlOcr(model_name='densenet-lite-gru', model_epoch=125, root='./bin/cnocr_models/jp', name='jp')
|
||||
|
||||
@cached_property
|
||||
@@ -42,7 +44,8 @@ class OcrModel:
|
||||
# Font: Various, 6 kinds
|
||||
# Charset: Numbers, Upper english characters, Chinese traditional characters
|
||||
# _num_classes: 5322
|
||||
from module.ocr.al_ocr import AlOcr
|
||||
return AlOcr(model_name='densenet-lite-gru', model_epoch=63, root='./bin/cnocr_models/tw', name='tw')
|
||||
|
||||
|
||||
OCR_MODEL = OcrModel()
|
||||
OCR_MODEL = OcrModel()
|
||||
|
||||
Reference in New Issue
Block a user