YCG09 / chinese_ocr

CTPN + DenseNet + CTC based end-to-end Chinese OCR implemented using tensorflow and keras
Apache License 2.0
2.74k stars 1.08k forks source link

文字定位有红色和绿色的框,有什么区别吗 #238

Closed cvnli closed 5 years ago

ShawDa commented 5 years ago
def draw_boxes(img,image_name,boxes,scale):
    base_name = image_name.split('/')[-1]
    with open('data/results/' + 'res_{}.txt'.format(base_name.split('.')[0]), 'w') as f:
        for box in boxes:
            if np.linalg.norm(box[0] - box[1]) < 5 or np.linalg.norm(box[3] - box[0]) < 5:
                continue
            if box[8] >= 0.9:
                color = (0, 0, 255)  # red
            else:
                color = (0, 255, 0)  # green

红色框置信度更高

cvnli commented 5 years ago
def draw_boxes(img,image_name,boxes,scale):
    base_name = image_name.split('/')[-1]
    with open('data/results/' + 'res_{}.txt'.format(base_name.split('.')[0]), 'w') as f:
        for box in boxes:
            if np.linalg.norm(box[0] - box[1]) < 5 or np.linalg.norm(box[3] - box[0]) < 5:
                continue
            if box[8] >= 0.9:
                color = (0, 0, 255)  # red
            else:
                color = (0, 255, 0)  # green

红色框置信度更高

谢谢