From 5635385c543a931ce0bcee9d152e0bad9792b0eb Mon Sep 17 00:00:00 2001 From: Leif <4603009@qq.com> Date: Thu, 25 Aug 2022 16:59:16 +0800 Subject: [PATCH] increase font sizes increase font sizes --- PPOCRLabel/PPOCRLabel.py | 5 +---- PPOCRLabel/libs/canvas.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 824df7a9a..c17db91a5 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -2335,10 +2335,7 @@ class MainWindow(QMainWindow): bbox = np.array(region['res']['boxes'][i]) rec_text = region['res']['rec_res'][i][0] - # polys to rectangles - x1, y1 = np.min(bbox[0::2]), np.min(bbox[::1]) - x2, y2 = np.max(bbox[0::2]), np.max(bbox[::1]) - rext_bbox = [[x1, y1], [x2, y1], [x2, y2], [x1, y2]] + rext_bbox = [[bbox[0], bbox[1]], [bbox[2], bbox[1]], [bbox[2], bbox[3]], [bbox[0], bbox[3]]] # save bbox to shape shape = Shape(label=rec_text, line_color=DEFAULT_LINE_COLOR, key_cls=None) diff --git a/PPOCRLabel/libs/canvas.py b/PPOCRLabel/libs/canvas.py index ae9511612..81f379951 100644 --- a/PPOCRLabel/libs/canvas.py +++ b/PPOCRLabel/libs/canvas.py @@ -627,7 +627,7 @@ class Canvas(QWidget): # adaptive BBOX label & index font size if self.pixmap: h, w = self.pixmap.size().height(), self.pixmap.size().width() - fontszie = int(max(h, w) / 96) + fontszie = int(max(h, w) / 48) for s in self.shapes: s.fontsize = fontszie