Commit 7372bdb0 authored by dmMaze's avatar dmMaze
Browse files

fix incorrect return type, close #852

parent 89e37196
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ class StariverDetector(TextDetectorBase):
            new_font_size = int(new_font_size * self.font_size_multiplier)
        return new_font_size

    def _detect(self, img: np.ndarray, proj: ProjImgTrans = None) -> Tuple[np.ndarray | List[TextBlock]]:
    def _detect(self, img: np.ndarray, proj: ProjImgTrans = None) -> Tuple[np.ndarray, List[TextBlock]]:
        self.update_token_if_needed()  # 在向服务器发送请求前尝试更新 Token
        if not self.token or self.token == '':
            self.logger.error(
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class YSGYoloDetector(TextDetectorBase):
    def is_ysg(self):
        return osp.basename(self.get_param_value('model path').startswith('ysg'))

    def _detect(self, img: np.ndarray, proj: ProjImgTrans = None) -> Tuple[np.ndarray | List[TextBlock]]:
    def _detect(self, img: np.ndarray, proj: ProjImgTrans = None) -> Tuple[np.ndarray, List[TextBlock]]:

        result = self.yolo.predict(
            source=img, save=False, show=False, verbose=False,