AI
基于paddlehub和wechaty实现一句话给你emoji过来【需添加实战】
paddleOCR--提取图片或PDF表格内容
sentence-transformers的使用
语音转文字-Whisper
pytorch版本对应问题
moviepy和scenedetect的用法
本地搭建AI大模型
DeepSeek使用技巧
DeepSeek实战
DeepSeek部署
DeepSeek R1打造个人知识库
DeepSeek+即梦
OpenManus本地部署
本文档使用 MrDoc 发布
-
+
up
down
首页
paddleOCR--提取图片或PDF表格内容
## 项目介绍 [paddleOCR](https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.6) ## 安装 环境是python 3.10.11 ``` pip install paddleocr pip install paddlepaddle ``` 安装后,使用的时候,需要将paddleocr下的ppstructure目录拷贝到当前目录。如下:  ## 实战 for 版面分析+表格识别 ``` import os import cv2 from paddleocr import PPStructure,draw_structure_result,save_structure_res table_engine = PPStructure(show_log=True) # 将会下载模型 # 如需要下载图片分类模型,需要paddleclas安装包,然后使用 # table_engine = PPStructure(show_log=True, image_orientation=True) save_folder = './output' img_path = '11.png' img = cv2.imread(img_path) result = table_engine(img) save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0]) # 到这一步就已经完成了 for line in result: line.pop('img') print(line) from PIL import Image font_path = 'doc/fonts/simfang.ttf' # PaddleOCR下提供字体包 image = Image.open(img_path).convert('RGB') im_show = draw_structure_result(image, result,font_path=font_path) im_show = Image.fromarray(im_show) im_show.save('result.jpg') ``` 看到上面save_structure_res函数执行完,就已经完成了提取,具体如下: > 原图  > 识别结果   
laihui126
2023年8月4日 23:55
分享文档
收藏文档
上一篇
下一篇
微信扫一扫
复制链接
手机扫一扫进行分享
复制链接
关于 MrDoc
觅道文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅道文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅道文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
下载Markdown文件
分享
链接
类型
密码
更新密码