新网站做百度百科,广昌网站建设,公司建网站多少钱一个月,html登录页面制作一、什么是版面分析
版面分析技术#xff0c;主要是对图片形式的文档进行版面分析#xff0c;将文档划分为文字、标题、表格、图片以及列表5类区域#xff0c;如下图所示#xff1a; 二、应用场景
2.1 合同比对 2.2 文本类型划分 2.3 通用文档的还原
版面分析技术可将以…一、什么是版面分析
版面分析技术主要是对图片形式的文档进行版面分析将文档划分为文字、标题、表格、图片以及列表5类区域如下图所示 二、应用场景
2.1 合同比对 2.2 文本类型划分 2.3 通用文档的还原
版面分析技术可将以word、pdf、图片等非结构化文档存储的信息还原为半结构化的电子数据是非结构化文档信息利用首要任务。 三、paddle的版面分析
3.1 快速体验 参考网址链接
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.7/ppstructure/docs/quickstart.md 环境搭建 1)安装paddlepaddle python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple【GPU版本】 python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple【CPU版本】 2 安装 paddleocr推荐使用2.6版本 pip3 install paddleocr2.6.0.3 # 安装 图像方向分类依赖包paddleclas如不需要图像方向分类功能可跳过 pip3 install paddleclas2.4.3 运行命令 1图像方向分类版面分析表格识别 paddleocr --image_dirppstructure/docs/table/1.png --typestructure --image_orientationtrue 2 版面分析表格识别 paddleocr --image_dirppstructure/docs/table/1.png --typestructure 3版面分析 paddleocr --image_dirppstructure/docs/table/1.png --typestructure --tablefalse --ocrfalse 4表格识别 paddleocr --image_dirppstructure/docs/table/table.jpg --typestructure --layoutfalse5版面恢复作用将PDF的文档转换成通用word文档 仅仅处理pdf文档 paddleocr --image_dirppstructure/recovery/UnrealText.pdf --typestructure --recoverytrue --use_pdf2docx_apitrue 3.2 源码程序实现 1) 安装PaddlePaddle 环境搭建 python3 -m pip install --upgrade pip # GPU安装 python3 -m pip install paddlepaddle-gpu2.3 -i https://mirror.baidu.com/pypi/simple # CPU安装 python3 -m pip install paddlepaddle2.3 -i https://mirror.baidu.com/pypi/simple 2安装PaddleDetection git clone https://github.com/PaddlePaddle/PaddleDetection.git cd PaddleDetection python3 -m pip install -r requirements.txt 需要自己训练数据集的可以参考链接的攻略
PaddleOCR/ppstructure/layout/README_ch.md at release/2.7 · PaddlePaddle/PaddleOCR · GitHub
预训练模型或者预测模型下载的官方网址为 PaddleOCR/ppstructure/docs/models_list.md at release/2.7 · PaddlePaddle/PaddleOCR · GitHub 使用源码测试的命令更换weights模型路径
python3 tools/infer.py \-c configs/picodet/legacy_model/application/layout_analysis/picodet_lcnet_x1_0_layout.yml \--slim_config configs/picodet/legacy_model/application/layout_analysis/picodet_lcnet_x2_5_layout.yml \-o weightsoutput/picodet_lcnet_x2_5_layout/best_model.pdparams \--infer_imgdocs/images/layout.jpg \--output_diroutput_dir/ \--draw_threshold0.5
直接使用推理模型进行预测
python3 deploy/python/infer.py \--model_diroutput_inference/picodet_lcnet_x1_0_layout/ \--image_filedocs/images/layout.jpg \--deviceGPU 备注一些推理模型下载后没有对应的yaml文件会导致执行上面的指令出错所以在运行上面的命令的时候将下载的模型看看是否有对应的yaml文件。