English | [简体中文](README_ch.md)
# Layout analysis
- [1. Introduction](#1-Introduction)
- [2. Quick start](#2-Quick-start)
- [3. Install](#3-Install)
- [3.1 Install PaddlePaddle](#31-Install-paddlepaddle)
- [3.2 Install PaddleDetection](#32-Install-paddledetection)
- [4. Data preparation](#4-Data-preparation)
- [4.1 English data set](#41-English-data-set)
- [4.2 More datasets](#42-More-datasets)
- [5. Start training](#5-Start-training)
- [5.1 Train](#51-Train)
- [5.2 FGD Distillation training](#52-Fgd-distillation-training)
- [6. Model evaluation and prediction](#6-Model-evaluation-and-prediction)
- [6.1 Indicator evaluation](#61-Indicator-evaluation)
- [6.2 Test layout analysis results](#62-Test-layout-analysis-results)
- [7. Model export and inference](#7-Model-export-and-inference)
- [7.1 Model export](#71-Model-export)
- [7.2 Model inference](#72-Model-inference)
## 1. Introduction
Layout analysis refers to the regional division of documents in the form of pictures and the positioning of key areas, such as text, title, table, picture, etc. The layout analysis algorithm is based on the lightweight model PP-picodet of [PaddleDetection]( https://github.com/PaddlePaddle/PaddleDetection ), including English layout analysis, Chinese layout analysis and table layout analysis models. English layout analysis models can detect document layout elements such as text, title, table, figure, list. Chinese layout analysis models can detect document layout elements such as text, figure, figure caption, table, table caption, header, footer, reference, and equation. Table layout analysis models can detect table regions.
<div align="center">
<img src="../docs/layout/layout.png" width="800">
</div>
## 2. Quick start
PP-Structure currently provides layout analysis models in Chinese, English and table documents. For the model link, see [models_list](../docs/models_list_en.md). The whl package is also provided for quick use, see [quickstart](../docs/quickstart_en.md) for details.
## 3. Install
### 3.1. Install PaddlePaddle
- **(1) Install PaddlePaddle**
```bash
python3 -m pip install --upgrade pip
# GPU Install
python3 -m pip install "paddlepaddle-gpu>=2.3" -i https://mirror.baidu.com/pypi/simple
# CPU Install
python3 -m pip install "paddlepaddle>=2.3" -i https://mirror.baidu.com/pypi/simple
```
For more requirements, please refer to the instructions in the [Install file](https://www.paddlepaddle.org.cn/install/quick)。
### 3.2. Install PaddleDetection
- **(1)Download PaddleDetection Source code**
```bash
git clone https://github.com/PaddlePaddle/PaddleDetection.git
```
- **(2)Install third-party libraries**
```bash
cd PaddleDetection
python3 -m pip install -r requirements.txt
```
## 4. Data preparation
If you want to experience the prediction process directly, you can skip data preparation and download the pre-training model.
### 4.1. English data set
Download document analysis data set [PubLayNet](https://developer.ibm.com/exchanges/data/all/publaynet/)(Dataset 96G),contains 5 classes:`{0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"}`
```
# Download data
wget https://dax-cdn.cdn.appdomain.cloud/dax-publaynet/1.0.0/publaynet.tar.gz
# Decompress data
tar -xvf publaynet.tar.gz
```
Uncompressed **directory structure:**
```
|-publaynet
|- test
|- PMC1277013_00004.jpg
|- PMC1291385_00002.jpg
| ...
|- train.json
|- train
|- PMC1291385_00002.jpg
|- PMC1277013_00004.jpg
| ...
|- val.json
|- val
|- PMC538274_00004.jpg
|- PMC539300_00004.jpg
| ...
```
**data distribution:**
| File or Folder | Description | num |
| :------------- | :------------- | ------- |
| `train/` | Training set pictures | 335,703 |
| `val/` | Verification set pictures | 11,245 |
| `test/` | Test set pictures | 11,405 |
| `train.json` | Training set annotation files | - |
| `val.json` | Validation set dimension files | - |
**Data Annotation**
The JSON file contains the annotations of all images, and the data is stored in a dictionary nested manner.Contains the following keys:
- info,represents the dimension file info。
- licenses,represents the dimension file licenses。
- images,represents the list of image information in the annotation file,each element is the information of an image。The information of one of the images is as follows:
```
{
'file_name': 'PMC4055390_00006.jpg', # file_name
'height': 601, # image height
'width': 792, # image width
'id': 341427 # image id
}
```
- annotations, represents the list of annotation information of the target object in the annotation file,each element is the annotation information of a target object。The following is the annotation information of one of the target objects:
```
{
'segmentation': # Segmentation annotation of objects
'area': 60518.099043117836, # Area of object
'iscrowd': 0, # iscrowd
'image_id': 341427, # image id
'bbox': [50.58, 490.86, 240.15, 252.16], # bbox [x1,y1,w,h]
'category_id': 1, # category_id
'id': 3322348 # image id
}
```
### 4.2. More datasets
We provide CDLA(Chinese layout analysis), TableBank(Table layout analysis)etc. data set download links,process to the JSON format of the above annotation file,that is, the training can be conducted in the same way。
| dataset | 简介 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [cTDaR2019_cTDaR](https://cndplab-founder.github.io/cTDaR2019/) | For form detection (TRACKA) and form identification (TRACKB).Image types include historical data sets (beginning with cTDaR_t0, such as CTDAR_T00872.jpg) and modern data sets (beginning with cTDaR_t1, CTDAR_T10482.jpg). |
| [IIIT-AR-13K](http://cvit.iiit.ac.in/usodi/iiitar13k.php) | Data sets constructed by manually annotating figures or pages from publicly available annual reports, containing 5 categories:table, figure, natural image, logo, and signature. |
| [TableBank](https://github.com/doc-analysis/TableBank) | For table detection and recognition of large datasets, including Word and Latex document formats |
| [CDLA](https://github.com/buptlihang/CDLA) | Chinese document layout analysis data set, for Chinese literature (paper) scenarios, including 10 categories:Text, Title, Figure, Figure caption, Table, Table caption, Header, Footer, Reference, Equation |
| [DocBank](https://github.com/doc-analysis/DocBank) | Large-scale dataset (500K document pages) constructed using weakly supervised methods for document layout analysis, containing 12 categories:Author, Caption, Date, Equation, Figure, Footer, List, Paragraph, Reference, Section, Table, Title |
## 5. Start training
Training scripts, evaluation scripts, and prediction scripts are provided, and the PubLayNet pre-training model is used as an example in this section.
If you do not want training and directly experience the following process of model evaluation, prediction, motion to static, and inference, you can download the provided pre-trained model (PubLayNet dataset) and skip this part.
```
mkdir pretrained_model
cd pretrained_model
# Download PubLayNet pre-training model(Direct experience model evaluates, predicts, and turns static)
wget https://paddleocr.bj.bcebos.com/ppstructure/models/layout/picodet_lcnet_x1_0_fgd_layout.pdparams
# Download the PubLaynet inference model(Direct experience model reasoning)
wget https://paddleocr.bj.bcebos.com/ppstructure/models/layout/picodet_lcnet_x1_0_fgd_layout_infer.tar
```
If th
没有合适的资源?快使用搜索试试~ 我知道了~
PaddleOCR-release-2.6.zip
共1616个文件
py:383个
txt:267个
md:247个
5星 · 超过95%的资源 需积分: 23 21 下载量 139 浏览量
2022-11-30
10:16:16
上传
评论 1
收藏 121.95MB ZIP 举报
温馨提示
基于飞桨的OCR工具库,包含总模型仅8.6M的超轻量级中文OCR,单模型支持中英文数字组合识别、竖排文本识别、长文本识别。同时支持多种文本检测、文本识别的训练算法。
资源推荐
资源详情
资源评论
收起资源包目录
PaddleOCR-release-2.6.zip (1616个子文件)
gradlew.bat 2KB
demo_bare_metal.c 2KB
ocr_db_crnn.cc 23KB
roi_align_rotated.cc 19KB
db_post_process.cc 11KB
custom_relu_op.cc 4KB
crnn_process.cc 4KB
cls_process.cc 1KB
setup.cfg 97B
arm-none-eabi-gcc.cmake 3KB
auto-log.cmake 392B
clipper.cpp 135KB
ocr_clipper.cpp 135KB
postprocess_op.cpp 19KB
utility.cpp 13KB
general_detection_op.cpp 13KB
ocr_ppredictor.cpp 12KB
paddlestructure.cpp 10KB
ocr_db_post_process.cpp 10KB
main.cpp 7KB
ocr_rec.cpp 7KB
paddleocr.cpp 7KB
structure_table.cpp 7KB
ocr_cls.cpp 6KB
structure_layout.cpp 6KB
ocr_det.cpp 5KB
preprocess_op.cpp 5KB
ocr_crnn_process.cpp 5KB
native.cpp 4KB
args.cpp 4KB
ppredictor.cpp 3KB
preprocess.cpp 3KB
ocr_cls_process.cpp 1KB
predictor_input.cpp 750B
predictor_output.cpp 617B
roi_align_rotated.cu 14KB
custom_relu_op.cu 3KB
Dockerfile 2KB
Dockerfile 2KB
kie.gif 5.65MB
steps_en.gif 4.79MB
ppstructure.GIF 2.49MB
table.gif 1.86MB
multi-point.gif 818KB
paddlejs_demo.gif 554KB
.gitignore 469B
.gitignore 90B
.gitignore 55B
.gitignore 7B
.gitkeep 0B
build.gradle 3KB
build.gradle 558B
settings.gradle 15B
gradlew 5KB
clipper.h 15KB
native.h 5KB
postprocess_op.h 4KB
utility.h 3KB
ocr_det.h 3KB
ocr_rec.h 3KB
ocr_ppredictor.h 3KB
structure_table.h 3KB
structure_layout.h 2KB
ocr_cls.h 2KB
preprocess_op.h 2KB
paddlestructure.h 2KB
args.h 2KB
db_post_process.h 2KB
paddleocr.h 2KB
tvm_runtime.h 2KB
ppredictor.h 1KB
crnn_process.h 1KB
common.h 1KB
crt_config.h 1002B
predictor_output.h 926B
cls_process.h 905B
ocr_cls_process.h 798B
predictor_input.h 589B
ocr_crnn_process.h 527B
ocr_db_post_process.h 403B
preprocess.h 371B
.clang_format.hook 353B
ocr_clipper.hpp 15KB
index.html 369B
app.icns 8B
MANIFEST.in 294B
gradle-wrapper.jar 53KB
MainActivity.java 20KB
Predictor.java 9KB
SettingsActivity.java 9KB
Utils.java 5KB
AppCompatPreferenceActivity.java 4KB
OCRPredictorNative.java 3KB
OcrResultModel.java 2KB
ExampleInstrumentedTest.java 740B
ExampleUnitTest.java 391B
1bbe854b8817dedb8585e0732089fd1f752d2cec.jpeg 181KB
2769.jpeg 175KB
architecture.jpeg 122KB
ArT.jpg 3.12MB
共 1616 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
- 甜甜不加糖2023-07-25标题为PaddleOCR-release-2.6.zip的文件提供了一个可靠的OCR解决方案,能够帮助用户高效地处理文字识别任务。
- 啊看看2023-07-25这个文件的使用方法简单易懂,即使对于非专业的用户来说也能够快速上手。
- 蓝洱2023-07-25使用这个文件可以快速准确地识别图片中的文字,对于需要大量处理文字的工作非常有帮助。
- Xhinking2023-07-25这个文件提供了一种高效的OCR识别功能,简化了文字处理的流程。
- 老许的花开2023-07-25文件中的OCR算法经过优化,识别率相对稳定,可以满足一般场景的需求。
m0_72731342
- 粉丝: 4
- 资源: 1829
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- java人力资源HR管理系统源码数据库 MySQL源码类型 WebForm
- BT_esp32_370_DRV8833_BALANCE_verticalPID_turnPID.ino
- buildroot package使用示例
- C#ASP.NET快速开发平台源码带视频教程和操作手册数据库 SQL2008源码类型 WebForm
- 23网安六徐少方 20237209.cpp
- 多多买菜自动入库,拼多多自动入库使用
- a616354ce1a6e7d06267ae7821e38321.JPG
- 4e77c15f65be2f550de3265f33a4d427.JPG
- d25358831b9f038c041861d5add73551.JPG
- 大学专业课技术经济期末复习整理资料
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功