当前位置: 首页 > news >正文

有哪些网站可以做青旅义工网站框架

有哪些网站可以做青旅义工,网站框架,网络设计需求分析,上海公司查名一网通OCR模型调研及详细安装 1 搭建 Tesseract-OCR 环境。 1.1 注意需先手动安装Tesseract-OCR, 下载地址:https://digi.bib.uni-mannheim.de/tesseract/?CM;OD 注意:安装的时候选中中文包(安装时把所有选项都勾上)。 安装磁盘选择…

OCR模型调研及详细安装

1 搭建 Tesseract-OCR 环境。

1.1 注意需先手动安装Tesseract-OCR, 下载地址:https://digi.bib.uni-mannheim.de/tesseract/?C=M;O=D

注意:安装的时候选中中文包(安装时把所有选项都勾上)。
安装磁盘选择与运行的代码在同一磁盘。
安装 Tesseract-OCR 后,需将 Tesseract-OCR 对应的安装路径添加到系统环境变量中。安装完成后,使用命令,查看版本号和支持语言:
cd C:\Program Files\Tesseract-OCR  
tesseract -v tesseract --list-langs -v tesseract --list-langs 若有语言方面的Error,需将中文包 chi_sim.traineddata 下载到本地C:\Program Files\Tesseract-OCR 路径下。(见1.3下载语言包)

1.2 再安装python库pytesseract

pip install pytesseract

1.3 下载语言包,并放到Tesseract的目录下

下载地址:https://github.com/tesseract-ocr/tesseract/wiki/Data-Fileshttps://tesseract-ocr.github.io/tessdoc/Data-Files

1.4 代码块

def tesseract_to_str(image_path):"""Tesseract-OCR: 提取图片中的文字,返回 text字符串"""from PIL import Imageimport pytesseractimport osif not os.path.isfile(image_path):logging.info('          路径存在问题,请检查image_path: '.format(image_path))return ''image = Image.open(image_path)# 如果没有将tesseract的安装目录添加到系统环境变量中,则需要指定安装路径,pytesseract.pytesseract.tesseract_cmd = r"D:\Program_Files\Tesseract-OCR\tesseract.exe"testdata_dir_config = '--tessdata-dir D:/Program_Files/Tesseract-OCR/tessdata'# 调用pytesseract库提取文字,识别中文需指定语言lang='chi_sim'print('-'*20,'获取图中的文字','-'*20)try:text_from_image = pytesseract.image_to_string(image,  config=testdata_dir_config, lang='chi_sim')except Exception as e:logging.info('          识别文字失败:{} '.format(e))return ''# print('-' * 20, '获取图中的文字完成', '-' * 20)# print('text_from_tesseract: \n', text_from_image)return text_from_image

2 EasyOCR: 是一个基于 PyTorch 的 OCR 库。

pip install easyocr

源码

https://github.com/JaidedAI/EasyOCR
API详解见:https://blog.csdn.net/yohnyang/article/details/130300923

模型储存路径:

windows: C:\Users\username\.EasyOCR\
linux:/root/.EasyOCR/

代码

def easyocr_to_str(image_path):import easyocr# import os# os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"# reader = easyocr.Reader(['ch_sim','en'], gpu = False)print('result:1 \n', )reader = easyocr.Reader(['ch_sim',], gpu = False)print('result:2 \n', )result = reader.readtext(image_path)print('result: \n', result)for detection in result:print(detection[1])

问题

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.

修改:

网友说的方法:

添加如下代码

import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"

然而没用,然后修改了自己环境中的如下内容之后,不再报错了,即使将上述os内容注释,也不报错。

D:\ProgramFiles\miniconda3\envs\env_myenv\Library\bin路径下的libiomp5md.dll改为libiomp5md.dll.bk

识别文本示例:


3 Keras-OCR

源码

https://gitcode.com/gh_mirrors/ke/keras-ocr/overview?utm_source=artical_gitcode&index=top&type=card&webUrl

安装

安装 :keras-ocr支持Python >= 3.6和TensorFlow >= 2.0.0。
方法1: 从主分支安装
pip install git+https://github.com/faustomorales/keras-ocr.git#egg=keras-ocr
方法2: 从PyPi安装
pip install keras-ocr

4 Doctr 识别文档中的文本区域、图像和表格

项目地址

https://gitcode.com/gh_mirrors/do/doctr/overview?utm_source=artical_gitcode&index=top&type=card&webUrl&isLogin=1

安装

pip install "python-doctr[torch]"

首次运行会下载模型,存储在

C:\Users\hlj\.cache\doctr\models\db_resnet50-79bd7d70.pt
C:\Users\hlj\.cache\doctr\models\crnn_vgg16_bn-9762b0b0.pt

缺点

不支持中文模型
http://www.yayakq.cn/news/897807/

相关文章:

  • 网站内容全屏截屏怎么做单页网站后台
  • 网站怎么做网站收录在哪里建网站好
  • 外管局网站先支后收怎么做报告软件技术和软件工程有什么区别
  • 基于多站点的网站内容管理平台的管理与应用门店设计方案
  • 成都网站内容策划九一赣州人才网招聘
  • 中交建设集团网站企业展厅 设计 公司
  • 贵州能源网站 中企动力建设怎样租用个人网站空间
  • 大型餐饮网站建设青岛网站开发中心
  • 做外贸主要是哪些网站鬼佬做爰网站
  • 池州网站建设公司wordpress在哪里改首页关键词标题
  • 网站域名需icp备案吗软件开发需求文档怎么写
  • 网站icp备案信息是什么意思平面设计就业方向有哪些
  • 长宁网站建设制作wordpress 去掉category
  • 定制手机号码官方网站设计一个网站先做哪些构造
  • wordpress免费资讯主题上海关键词优化的技巧
  • 厦门市同安区建设工程质量安全监督站网站新浪sae 搭建wordpress
  • 网站整体规划方案排行榜哪个网站最好
  • 做网站用笔记本电脑什么是网络营销什么是传统营销
  • 建设个公司网站需要多少费用wordpress是不是做网页
  • 做网站备案要多久厦门网站建设cnmxcm
  • 文化传媒公司简介模板湘潭seo优化价格
  • 做网站的公司如何运营大学生50个创新产品设计
  • 网站建设 康盛设计嘉兴首页
  • 云南网站建设肖庆华精简wordpress博客程序
  • asp.net网站开发上为什么做腾讯网站
  • 机械网站建设公司推荐工业企业网络推广方案
  • 手机网站设计背景图片网站备案号被注销什么原因
  • xcode 网站开发wordpress 块
  • 现在可以用的网站电子工程师网名
  • 网站权重怎么提高常州模板网站建设价位