Fix: Remove OCR lang since planner is available for all

This commit is contained in:
LmeSzinc 2024-07-02 03:42:24 +08:00
parent 4cabc7c6ea
commit 4d4c65f9b5

View File

@ -41,26 +41,10 @@ class OcrPlannerResult(OcrWhiteLetterOnComplexBackground, OcrItemName):
min_box = (16, 20) min_box = (16, 20)
def __init__(self): def __init__(self):
# Planner currently CN only super().__init__(OCR_RESULT)
super().__init__(OCR_RESULT, lang='cn')
self.limited_area = OCR_RESULT.area self.limited_area = OCR_RESULT.area
self.limit_y = 720 self.limit_y = 720
def _match_result(
self,
result: str,
keyword_classes,
lang: str = 'cn',
ignore_punctuation=True,
ignore_digit=True):
return super()._match_result(
result,
keyword_classes,
lang,
ignore_punctuation,
ignore_digit,
)
def filter_detected(self, result: BoxedResult) -> bool: def filter_detected(self, result: BoxedResult) -> bool:
if not area_in_area(result.box, self.limited_area, threshold=0): if not area_in_area(result.box, self.limited_area, threshold=0):
return False return False