-
-
Notifications
You must be signed in to change notification settings - Fork 514
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
-
RapidOCR现有方案:
RapidOCR/python/rapidocr_onnxruntime/rapid_ocr_api.py
Lines 153 to 171 in 0dbac44
def sorted_boxes(dt_boxes): """ Sort text boxes in order from top to bottom, left to right args: dt_boxes(array):detected text boxes with shape [4, 2] return: sorted boxes(array) with shape [4, 2] """ num_boxes = dt_boxes.shape[0] sorted_boxes = sorted(dt_boxes, key=lambda x: (x[0][1], x[0][0])) _boxes = list(sorted_boxes) for i in range(num_boxes - 1): if abs(_boxes[i + 1][0][1] - _boxes[i][0][1]) < 10 and \ (_boxes[i + 1][0][0] < _boxes[i][0][0]): tmp = _boxes[i] _boxes[i] = _boxes[i + 1] _boxes[i + 1] = tmp return _boxes -
感谢小伙伴的指出,现改为PaddleOCR方案
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working