当前位置:   article > 正文

linux【centos 7】 yum 安装 tesseract 4.1_yum update tesseract

yum update tesseract

linux【centos 7】 yum 安装 tesseract 4.1


tesseract 作为 ocr 识别引擎,在 php (当然别的语言也行,例如:python)爬虫中用处巨大,例如:自动识别验证码。

首先可以通过 官网github 安装,自己源码编译,不过需要安装各种依赖,也容易出错,这里使用官方包管理器 yum 简化操作。

yum 本身自带的版本是 版本 3 ,过于老旧,很多 API 接口都不试用

[root@iZbp115r5t4hzamv0snvm1Z cim]# tesseract -v
tesseract 3.04.00
 leptonica-1.72
  libgif 4.1.6(?) : libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7 : libwebp 0.3.0
  • 1
  • 2
  • 3
  • 4

所以通过切换仓库,安装 4.1 版本,执行命令如下:

# yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
# sudo rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key
# yum update tesseract
# yum list tesseract
# yum install tesseract
# [yum install tesseract-langpack-deu] # 可选安装
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

如果执行命令报以下错误:

-bash: yum-config-manager: command not found
  • 1

请查看该文章:yum-config-manager 命令找不到的解决方法

具体操作流程;

[root@iZbp115r5t4hzamv0snvm1Z cim]# yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
Loaded plugins: fastestmirror
adding repo from: https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/

[download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_]
name=added from: https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
baseurl=https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
enabled=1


[root@iZbp115r5t4hzamv0snvm1Z cim]# sudo rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum update tesseract
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_    | 1.3 kB  00:00:00
download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_/pr |  15 kB  00:00:07
download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_                   171/171
Package(s) tesseract available, but not installed.
No packages marked for update
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum list tesseract
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
Available Packages
tesseract.x86_64 4.1.0+git4242-1.4 download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum install tesseract
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package tesseract.x86_64 0:4.1.0+git4242-1.4 will be installed
--> Processing Dependency: tesseract-langpack-osd >= 3.99 for package: tesseract-4.1.0+git4242-1.4.x86_64
--> Processing Dependency: tesseract-langpack-eng >= 3.99 for package: tesseract-4.1.0+git4242-1.4.x86_64
--> Processing Dependency: liblept.so.5()(64bit) for package: tesseract-4.1.0+git4242-1.4.x86_64
--> Running transaction check
---> Package leptonica.x86_64 0:1.72-2.el7 will be updated
---> Package leptonica.x86_64 0:1.76.0-2.5 will be an update
---> Package tesseract-langpack-eng.noarch 0:4.00~git30-5.5 will be installed
---> Package tesseract-langpack-osd.noarch 0:4.00~git30-5.5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================
 Package   Arch   Version
                    Repository                                                              Size
=================================================================================================
Installing:
 tesseract x86_64 4.1.0+git4242-1.4
                    download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_ 1.3 M
Installing for dependencies:
 tesseract-langpack-eng
           noarch 4.00~git30-5.5
                    download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_ 1.6 M
 tesseract-langpack-osd
           noarch 4.00~git30-5.5
                    download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_ 3.4 M
Updating for dependencies:
 leptonica x86_64 1.76.0-2.5
                    download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_ 1.0 M

Transaction Summary
=================================================================================================
Install  1 Package  (+2 Dependent packages)
Upgrade             ( 1 Dependent package)

Total download size: 7.3 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): tesseract-4.1.0+git4242-1.4.x86_64.rpm                             | 1.3 MB  00:00:06
(2/4): leptonica-1.76.0-2.5.x86_64.rpm                                    | 1.0 MB  00:00:07
(3/4): tesseract-langpack-eng-4.00~git30-5.5.noarch.rpm                   | 1.6 MB  00:00:01
(4/4): tesseract-langpack-osd-4.00~git30-5.5.noarch.rpm                   | 3.4 MB  00:00:02
-------------------------------------------------------------------------------------------------
Total                                                            751 kB/s | 7.3 MB  00:00:09
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tesseract-langpack-eng-4.00~git30-5.5.noarch                                  1/5
  Updating   : leptonica-1.76.0-2.5.x86_64                                                   2/5
  Installing : tesseract-4.1.0+git4242-1.4.x86_64                                            3/5
  Installing : tesseract-langpack-osd-4.00~git30-5.5.noarch                                  4/5
  Cleanup    : leptonica-1.72-2.el7.x86_64                                                   5/5
  Verifying  : tesseract-langpack-osd-4.00~git30-5.5.noarch                                  1/5
  Verifying  : leptonica-1.76.0-2.5.x86_64                                                   2/5
  Verifying  : tesseract-langpack-eng-4.00~git30-5.5.noarch                                  3/5
  Verifying  : tesseract-4.1.0+git4242-1.4.x86_64                                            4/5
  Verifying  : leptonica-1.72-2.el7.x86_64                                                   5/5

Installed:
  tesseract.x86_64 0:4.1.0+git4242-1.4

Dependency Installed:
  tesseract-langpack-eng.noarch 0:4.00~git30-5.5  tesseract-langpack-osd.noarch 0:4.00~git30-5.5

Dependency Updated:
  leptonica.x86_64 0:1.76.0-2.5

Complete!
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum install tesseract-langpack-deu
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package tesseract-langpack-deu.noarch 0:4.00~git30-5.5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================
 Package
       Arch   Version
                    Repository                                                              Size
=================================================================================================
Installing:
 tesseract-langpack-deu
       noarch 4.00~git30-5.5
                    download.opensuse.org_repositories_home_Alexander_Pozdnyakov_CentOS_7_ 763 k

Transaction Summary
=================================================================================================
Install  1 Package

Total download size: 763 k
Installed size: 1.5 M
Is this ok [y/d/N]: y
Downloading packages:
tesseract-langpack-deu-4.00~git30-5.5.noarch.rpm                          | 763 kB  00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tesseract-langpack-deu-4.00~git30-5.5.noarch                                  1/1
  Verifying  : tesseract-langpack-deu-4.00~git30-5.5.noarch                                  1/1

Installed:
  tesseract-langpack-deu.noarch 0:4.00~git30-5.5

Complete!
[root@iZbp115r5t4hzamv0snvm1Z cim]# tesseract -v
tesseract 4.1.1-rc2-20-g01fb
 leptonica-1.76.0
  libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7 : libwebp 0.3.0
 Found AVX512BW
 Found AVX512F
 Found AVX2
 Found AVX
 Found FMA
 Found SSE
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/119825?site
推荐阅读
相关标签
  

闽ICP备14008679号