mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-12-04 12:40:16 +00:00
Fix: 修复登录, 增加章节名OCR纠错
This commit is contained in:
parent
61aa7d8340
commit
088aca3c95
@ -31,6 +31,13 @@ def ensure_chapter_index(name):
|
|||||||
return 2
|
return 2
|
||||||
|
|
||||||
|
|
||||||
|
def ocr_result_process(result):
|
||||||
|
result = result.lower().replace('--', '-')
|
||||||
|
if len(result) == 2 and result[0].isdigit():
|
||||||
|
result = '-'.join(result)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def separate_name(name):
|
def separate_name(name):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
@ -145,7 +152,7 @@ class CampaignOcr:
|
|||||||
result = ocr.ocr(image)
|
result = ocr.ocr(image)
|
||||||
if not isinstance(result, list):
|
if not isinstance(result, list):
|
||||||
result = [result]
|
result = [result]
|
||||||
result = [res.lower().replace('--', '-') for res in result]
|
result = [ocr_result_process(res) for res in result]
|
||||||
|
|
||||||
chapter = [separate_name(res)[0] for res in result]
|
chapter = [separate_name(res)[0] for res in result]
|
||||||
counter = collections.Counter(chapter)
|
counter = collections.Counter(chapter)
|
||||||
|
Loading…
Reference in New Issue
Block a user