From f85be40c98bd48d4ae8f0785a135c007b34773be Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:23:27 +0800 Subject: [PATCH] Fix: import BoxedResult --- module/ocr/ocr.py | 2 +- module/ocr/utils.py | 5 ++++- tasks/forgotten_hall/ui.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/ocr/ocr.py b/module/ocr/ocr.py index 8a70370a0..485ad6317 100644 --- a/module/ocr/ocr.py +++ b/module/ocr/ocr.py @@ -3,7 +3,7 @@ import time from datetime import timedelta import cv2 -from ppocronnx.predict_system import BoxedResult +from pponnxcr.predict_system import BoxedResult import module.config.server as server from module.base.button import ButtonWrapper diff --git a/module/ocr/utils.py b/module/ocr/utils.py index e8ff579b1..357836ff9 100644 --- a/module/ocr/utils.py +++ b/module/ocr/utils.py @@ -1,6 +1,6 @@ import itertools -from ppocronnx.predict_system import BoxedResult +from pponnxcr.predict_system import BoxedResult from module.base.utils import area_in_area, area_offset @@ -45,6 +45,9 @@ def merge_buttons(buttons: list[BoxedResult], thres_x=20, thres_y=20) -> list[Bo Returns: """ + if thres_x <= 0 and thres_y <= 0: + return buttons + dic_button = {button.box: button for button in buttons} set_merged = set() for left, right in itertools.combinations(dic_button.items(), 2): diff --git a/tasks/forgotten_hall/ui.py b/tasks/forgotten_hall/ui.py index 1d2e72ec2..715221322 100644 --- a/tasks/forgotten_hall/ui.py +++ b/tasks/forgotten_hall/ui.py @@ -1,6 +1,6 @@ import cv2 import numpy as np -from ppocronnx.predict_system import BoxedResult +from pponnxcr.predict_system import BoxedResult from module.base.base import ModuleBase from module.base.timer import Timer