diff --git a/README.md b/README.md index 39a30e2266f97552ceb4b6f51b93aa91c50ce224..501c687527a51986d1b2ec690d94df4019e8c764 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ PaddleOCR support a variety of cutting-edge algorithms related to OCR, and devel - SER (Semantic entity recognition)
- +
diff --git a/README_ch.md b/README_ch.md index 16246b36bde9afbf067fd9911fe47f157ef3f62b..227232338740b4025ba1d2302b1d02c9f209e1aa 100755 --- a/README_ch.md +++ b/README_ch.md @@ -237,7 +237,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
- +
- RE(关系提取) diff --git a/ppocr/utils/visual.py b/ppocr/utils/visual.py index 5bd805ea6e76be37612a142102beab492bece941..b6de446593984788bea5c03026f4a5b8c0187909 100644 --- a/ppocr/utils/visual.py +++ b/ppocr/utils/visual.py @@ -51,20 +51,22 @@ def draw_ser_results(image, bbox = trans_poly_to_bbox(ocr_info["points"]) draw_box_txt(bbox, text, draw, font, font_size, color) - img_new = Image.blend(image, img_new, 0.5) + img_new = Image.blend(image, img_new, 0.7) return np.array(img_new) def draw_box_txt(bbox, text, draw, font, font_size, color): + # draw ocr results outline bbox = ((bbox[0], bbox[1]), (bbox[2], bbox[3])) draw.rectangle(bbox, fill=color) # draw ocr results - start_y = max(0, bbox[0][1] - font_size) tw = font.getsize(text)[0] + th = font.getsize(text)[1] + start_y = max(0, bbox[0][1] - th) draw.rectangle( - [(bbox[0][0] + 1, start_y), (bbox[0][0] + tw + 1, start_y + font_size)], + [(bbox[0][0] + 1, start_y), (bbox[0][0] + tw + 1, start_y + th)], fill=(0, 0, 255)) draw.text((bbox[0][0] + 1, start_y), text, fill=(255, 255, 255), font=font) diff --git a/ppstructure/README.md b/ppstructure/README.md index 9d503ca8e45f21407afc5a1df04d0ecb690f94f9..e44ba588601b1049ccb087bf5985f2c13d6f451d 100644 --- a/ppstructure/README.md +++ b/ppstructure/README.md @@ -62,7 +62,7 @@ The following figure shows the effect of layout recovery based on the results of Different colored boxes in the figure represent different categories.
- +
diff --git a/ppstructure/README_ch.md b/ppstructure/README_ch.md index 050740b3b319ff1e685926b5b85282e5730edb77..53c251d15417291a0d024ef90d0013fe30ef42d3 100644 --- a/ppstructure/README_ch.md +++ b/ppstructure/README_ch.md @@ -78,7 +78,7 @@ PP-StructureV2支持各个模块独立使用或灵活搭配,如,可以单独
- +