From c0ea753f1785fa7f92f1bb1a96b8ed38498e4139 Mon Sep 17 00:00:00 2001 From: d2623587501 <71634460+d2623587501@users.noreply.github.com> Date: Mon, 21 Nov 2022 18:25:39 +0800 Subject: [PATCH] Modify the output bug of PaddleOCR==2.6.1 update. (#8391) --- PPOCRLabel/PPOCRLabel.py | 2 +- PPOCRLabel/libs/autoDialog.py | 2 +- PPOCRLabel/libs/canvas.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 0a3ae1cb..0caee0a6 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -1177,7 +1177,7 @@ class MainWindow(QMainWindow): # print('rm empty label') return item = self.shapesToItems[shape] - item.setText(shape.label) + item.setText(shape.label[0]) self.updateComboBox() # ADD: diff --git a/PPOCRLabel/libs/autoDialog.py b/PPOCRLabel/libs/autoDialog.py index 189a590d..55636eec 100644 --- a/PPOCRLabel/libs/autoDialog.py +++ b/PPOCRLabel/libs/autoDialog.py @@ -40,7 +40,7 @@ class Worker(QThread): if self.model == 'paddle': h, w, _ = cv2.imdecode(np.fromfile(Imgpath, dtype=np.uint8), 1).shape if h > 32 and w > 32: - self.result_dic = self.ocr.ocr(Imgpath, cls=True, det=True) + self.result_dic = self.ocr.ocr(Imgpath, cls=True, det=True)[0] else: print('The size of', Imgpath, 'is too small to be recognised') self.result_dic = None diff --git a/PPOCRLabel/libs/canvas.py b/PPOCRLabel/libs/canvas.py index 44d899cb..462c70be 100644 --- a/PPOCRLabel/libs/canvas.py +++ b/PPOCRLabel/libs/canvas.py @@ -237,7 +237,7 @@ class Canvas(QWidget): self.hShape.highlightClear() self.hVertex, self.hShape = None, shape self.setToolTip( - "Click & drag to move shape '%s'" % shape.label) + "Click & drag to move shape '%s'" % shape.label[0]) self.setStatusTip(self.toolTip()) self.overrideCursor(CURSOR_GRAB) self.update() -- GitLab