diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 824df7a9afa61e35fb214b9b7617bc7a2e081e05..c17db91a5b5cd9d3cbb4b5bf6c87afd745d0870d 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 ae9511612a2ba83001c12ae8ed82498952207f98..81f37995126140b03650f5ddea37ea282d5ceb09 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