Skip to content

Commit

Permalink
replace image in layoutparse doc
Browse files Browse the repository at this point in the history
  • Loading branch information
WenmuZhou committed Jul 29, 2021
1 parent 3429122 commit 8a4d171
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Binary file modified doc/table/result_all.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/table/result_text.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ppstructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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.

Expand All @@ -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|
Expand Down
11 changes: 5 additions & 6 deletions ppstructure/README_ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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. 预测引擎推理

使用如下命令即可完成预测引擎的推理

Expand All @@ -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**

|模型名称|模型简介|配置文件|推理模型大小|下载地址|
| --- | --- | --- | --- | --- |
Expand Down
6 changes: 3 additions & 3 deletions ppstructure/layout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

<a name="使用"></a>
Expand All @@ -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]
Expand Down Expand Up @@ -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:https://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

<a name="后处理"></a>

Expand Down

0 comments on commit 8a4d171

Please sign in to comment.