def draw_ocr(image, boxes, txts=None, scores=None, drop_score=0.5, font_path='./doc/simfang.ttf'):
    '\n    Visualize the results of OCR detection and recognition\n    args:\n        image(Image|array): RGB image\n        boxes(list): boxes with shape(N, 4, 2)\n        txts(list): the texts\n        scores(list): txxs corresponding scores\n        drop_score(float): only scores greater than drop_threshold will be visualized\n        font_path: the path of font which is used to draw text\n    return(array):\n        the visualized img\n    '
    if (scores is None):
        scores = ([1] * len(boxes))
    box_num = len(boxes)
    for i in range(box_num):
        if ((scores is not None) and ((scores[i] < drop_score) or math.isnan(scores[i]))):
            continue
        box = np.reshape(np.array(boxes[i]), [(- 1), 1, 2]).astype(np.int64)
        image = cv2.polylines(np.array(image), [box], True, (255, 0, 0), 2)
    if (txts is not None):
        img = np.array(resize_img(image, input_size=600))
        txt_img = text_visual(txts, scores, img_h=img.shape[0], img_w=600, threshold=drop_score, font_path=font_path)
        img = np.concatenate([np.array(img), np.array(txt_img)], axis=1)
        return img
    return image
Visualize the results of OCR detection and recognition
args:
    image(Image|array): RGB image
    boxes(list): boxes with shape(N, 4, 2)
    txts(list): the texts
    scores(list): txxs corresponding scores
    drop_score(float): only scores greater than drop_threshold will be visualized
    font_path: the path of font which is used to draw text
return(array):
    the visualized img
def draw_ocr(image, boxes, txts=None, scores=None, drop_score=0.5, font_path='./doc/simfang.ttf'):
    '\n    Visualize the results of OCR detection and recognition\n    args:\n        image(Image|array): RGB image\n        boxes(list): boxes with shape(N, 4, 2)\n        txts(list): the texts\n        scores(list): txxs corresponding scores\n        drop_score(float): only scores greater than drop_threshold will be visualized\n        font_path: the path of font which is used to draw text\n    return(array):\n        the visualized img\n    '
    if (scores is None):
        scores = ([1] * len(boxes))
    box_num = len(boxes)
    for i in range(box_num):
        if ((scores is not None) and ((scores[i] < drop_score) or math.isnan(scores[i]))):
            continue
        box = np.reshape(np.array(boxes[i]), [(- 1), 1, 2]).astype(np.int64)
        image = cv2.polylines(np.array(image), [box], True, (255, 0, 0), 2)
    if (txts is not None):
        img = np.array(resize_img(image, input_size=600))
        txt_img = text_visual(txts, scores, img_h=img.shape[0], img_w=600, threshold=drop_score, font_path=font_path)
        img = np.concatenate([np.array(img), np.array(txt_img)], axis=1)
        return img
    return image