From a30dbf415ade6ebf07bef78bd5176055b5a84cb5 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Tue, 8 Jun 2021 14:31:53 +0800 Subject: [PATCH] add simple doc of whl --- ppstructure/README_ch.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/ppstructure/README_ch.md b/ppstructure/README_ch.md index 7ad154f8..22505ad8 100644 --- a/ppstructure/README_ch.md +++ b/ppstructure/README_ch.md @@ -1 +1,30 @@ -# TableStructurer \ No newline at end of file +# TableStructurer + +1. 代码使用 +```python +import cv2 +from paddlestructure import PaddleStructure,draw_result + +table_engine = PaddleStructure( + output='./output/table', + show_log=True) + +img_path = '../doc/table/1.png' +img = cv2.imread(img_path) +result = table_engine(img) +for line in result: + print(line) + +from PIL import Image + +font_path = 'path/tp/PaddleOCR/doc/fonts/simfang.ttf' +image = Image.open(img_path).convert('RGB') +im_show = draw_result(image, result,font_path=font_path) +im_show = Image.fromarray(im_show) +im_show.save('result.jpg') +``` + +2. 命令行使用 +```bash +paddlestructure --image_dir=../doc/table/1.png +``` -- GitLab