当前位置:网站首页>keras-ocr实例测试
keras-ocr实例测试
2022-07-27 05:23:00 【sin_404】
keras-ocr
文档地址
参考文章
错误集合
pip install ‘numpy1.19’ --force-reinstall 重装库版本
pip install 'h5py2.10.0’ --force-reinstall
code example
import matplotlib.pyplot as plt
import keras_ocr
# keras-ocr will automatically download pretrained
# weights for the detector and recognizer.
pipeline = keras_ocr.pipeline.Pipeline()
# Get a set of three example images
# 要一批识别默认的三张图,大概需要预留8g内存,这里只贴两张
images = [
keras_ocr.tools.read(url) for url in [
# 'https://upload.wikimedia.org/wikipedia/commons/b/bd/Army_Reserves_Recruitment_Banner_MOD_45156284.jpg',
'http://5b0988e595225.cdn.sohucs.com/images/20170905/44ecb27c4e5349e28abcbff8f3a6d4d2.jpeg',
'https://upload.wikimedia.org/wikipedia/commons/b/b4/EUBanana-500x112.jpg'
]
]
# Each list of predictions in prediction_groups is a list of
# (word, box) tuples.
prediction_groups = pipeline.recognize(images)
# Plot the predictions
fig, axs = plt.subplots(nrows=len(images), figsize=(20, 20))
for ax, image, predictions in zip(axs, images, prediction_groups):
keras_ocr.tools.drawAnnotations(image=image, predictions=predictions, ax=ax)
# keras_ocr.tools.drawAnnotations(image=images[-1], predictions=prediction_groups[-1], ax=axs)
plt.show()
效果图
边栏推荐
猜你喜欢

LAMP--源码编译安装

IP core summary

面试常问的问题总结【呕心沥血熬了一个晚上总结的】

Source code compilation and installation lamp and discuz Forum

RAID详解与配置

Interpretation of unity desktop version 7.6

账号管理与权限

Cesium tutorial (1) interface introduction -3dfiles loading - change mouse operation settings

Raid explanation and configuration

PXE高效批量网络装机
随机推荐
jmeter简介
PLL of IP core
Shell script backup MySQL database
Linu performance tuning: how can we alleviate the situation in the face of DDoS attacks?
Source code compilation and installation lamp and discuz Forum
FTP服务器的搭建
Addition, deletion, modification and query of the database at the terminal
Summary of test basis
Introduction to hash table
iptables防火墙及SNAT和DNAT
Shell sentence judgment exercise
Summary of Internet simple protocol
[first blog - outlook]
ArcGIS for JS API entry series
Source code compilation and installation LNMP and discuz Forum
Lamp -- source code compilation and installation
互联网简单协议概括
Use of getattr, hasattr, delattr and setattr in reflectors
IP core summary
测试基础概括
