import os def draw_debug_img(html_path): err_cnt = 0 with open(html_path, 'w') as html: html.write('\n\n') html.write('\n') html.write( "" ) image_list = [] path = "./det_results/310_gt/" #path = "infer_results/" for i, filename in enumerate(sorted(os.listdir(path))): if filename.endswith("txt"): continue print(filename) # The image path base = "{}/{}".format(path, filename) base_2 = "../PaddleOCR/det_results/ch_PPOCRV2_infer/{}".format( filename) base_3 = "../PaddleOCR/det_results/ch_ppocr_mobile_infer/{}".format( filename) if True: html.write("\n") html.write(f'' % (base)) html.write('' % (base_2)) html.write('' % (base_3)) html.write("\n") html.write('\n') html.write('
{filename}\n GT') html.write('GT\nPPOCRV2\nppocr_mobile\n
\n') html.write('\n\n') print("ok") #print("all cnt: {}, err cnt: {}, acc: {}".format(len(imgs), err_cnt, 1.0 * (len(imgs) - err_cnt) / len(imgs))) return if __name__ == "__main__": html_path = "sys_visual_iou_310.html" draw_debug_img()