diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 0a3ae1cb3b8fc004aa7c48dc86b6546a80e17a0f..0caee0a612c7d62169742e466c18bd7d0adaba27 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 189a590de851228e08d71f1dd2c00c823b9c2b0c..55636eec0fb35add23224cfc6917374d837f2191 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 44d899cbc9f21793f89c498cf844c95e418b08a1..462c70bee9514259d9050e4e6dad0f01ebb82d0a 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()