diff --git a/doc/table/result_all.jpg b/doc/table/result_all.jpg index 3dd9840643989f1049c228c201b43f9ed89a5fcb..3bffd40ed8821bb5259337bc7651cde51c5a7861 100644 Binary files a/doc/table/result_all.jpg and b/doc/table/result_all.jpg differ diff --git a/doc/table/result_text.jpg b/doc/table/result_text.jpg index 94c9bce4a73b2764bb9791972f62a3a5b37fed45..5f164a1ab10d3f3e63c761e6e059c2905ba9c878 100644 Binary files a/doc/table/result_text.jpg and b/doc/table/result_text.jpg differ diff --git a/ppstructure/README.md b/ppstructure/README.md index edd106a27149c8e10ee898f561132e8477af39ae..782aa624d7248974c7f79c70b093c325bb322f81 100644 --- a/ppstructure/README.md +++ b/ppstructure/README.md @@ -7,7 +7,7 @@ PaddleStructure is an OCR toolkit for complex layout analysis. It can divide doc **install layoutparser** ```sh -pip3 install https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl +pip3 install -U https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl ``` **install paddlestructure** @@ -86,7 +86,7 @@ Layout analysis divides the document data into regions, including the use of Pyt Table OCR converts table image into excel documents, which include the detection and recognition of table text and the prediction of table structure and cell coordinates. For detailed, please refer to [document](table/README.md) -### 3. Predictive by inference engine +## 3. Predictive by inference engine Use the following commands to complete the inference. @@ -95,7 +95,7 @@ python3 table/predict_system.py --det_model_dir=path/to/det_model_dir --rec_mode ``` After running, each image will have a directory with the same name under the directory specified in the output field. Each table in the picture will be stored as an excel, and the excel file name will be the coordinates of the table in the image. -# 3. Model List +**Model List** |model name|description|config|model size|download| diff --git a/ppstructure/README_ch.md b/ppstructure/README_ch.md index f9dc56ab264c377c81ba8328d5103cee801a000c..e1f83da6abbca641cd20ced392bd16776f779edd 100644 --- a/ppstructure/README_ch.md +++ b/ppstructure/README_ch.md @@ -8,7 +8,7 @@ PaddleStructure是一个用于复杂版面分析的OCR工具包,其能够对 **安装 layoutparser** ```sh -pip3 install https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl +pip3 install -U https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl ``` **安装 paddlestructure** @@ -80,15 +80,15 @@ im_show.save('result.jpg') 在PaddleStructure中,图片会先经由layoutparser进行版面分析,在版面分析中,会对图片里的区域进行分类,包括**文字、标题、图片、列表和表格**5类。对于前4类区域,直接使用PP-OCR完成对应区域文字检测与识别。对于表格类区域,经过Table OCR处理后,表格图片转换为相同表格样式的Excel文件。 -### 2.1 LayoutParser +### 2.1 版面分析 版面分析对文档数据进行区域分类,其中包括版面分析工具的Python脚本使用、提取指定类别检测框、性能指标以及自定义训练版面分析模型,详细内容可以参考[文档](layout/README.md)。 -### 2.2 Table OCR +### 2.2 表格识别 Table OCR将表格图片转换为excel文档,其中包含对于表格文本的检测和识别以及对于表格结构和单元格坐标的预测,详细说明参考[文档](table/README_ch.md) -### 3. 预测引擎推理 +## 3. 预测引擎推理 使用如下命令即可完成预测引擎的推理 @@ -97,8 +97,7 @@ python3 table/predict_system.py --det_model_dir=path/to/det_model_dir --rec_mode ``` 运行完成后,每张图片会output字段指定的目录下有一个同名目录,图片里的每个表格会存储为一个excel,excel文件名为表格在图片里的坐标。 -# 3. Model List - +**Model List** |模型名称|模型简介|配置文件|推理模型大小|下载地址| | --- | --- | --- | --- | --- | diff --git a/ppstructure/layout/README.md b/ppstructure/layout/README.md index 274a8c63a58543d3769bbd4b11133496e74f405a..c81b58d7c1c509a2d27cfb96fbad91ba317ad6fa 100644 --- a/ppstructure/layout/README.md +++ b/ppstructure/layout/README.md @@ -10,8 +10,7 @@ ## 1. 安装whl包 ```bash -wget https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl -pip install -U layoutparser-0.0.0-py3-none-any.whl +pip install -U https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl ``` @@ -21,6 +20,7 @@ pip install -U layoutparser-0.0.0-py3-none-any.whl 使用layoutparser识别给定文档的布局: ```python +import cv2 import layoutparser as lp image = cv2.imread("imags/paper-image.jpg") image = image[..., ::-1] @@ -67,7 +67,7 @@ lp.draw_box(image, layout, box_width=3, show_element_type=True) | [PubLayNet](https://github.com/ibm-aur-nlp/PubLayNet) | lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config | {0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"} | * TableBank word和TableBank latex分别在word文档、latex文档数据集训练; -* 下载TableBank数据集同时包含word和latex。 +* 下载的TableBank数据集里同时包含word和latex。