当前位置:网站首页>MMOCR使用指南
MMOCR使用指南
2022-07-26 00:38:00 【算法之名】
MMOCR是通用视觉框架OpenMMLab的光学字符识别器。
安装配置环境
MMOCR github主页:GitHub - open-mmlab/mmocr: OpenMMLab Text Detection, Recognition and Understanding Toolbox
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.htmlpip install mmdet -i https://pypi.tuna.tsinghua.edu.cn/simplepip install lmdbpip install shapelypip install rapidfuzzpip install lanmspip install pyclipperpip install scikit-imagepip install imgaug验证是否安装成功代码
import torch, torchvisionimport mmcvfrom mmcv.ops import get_compiling_cuda_version, get_compiler_versionimport mmdetimport mmocrfrom mmocr.utils.ocr import MMOCRmmocr = MMOCR(det=None, recog='SAR', device='cpu')print('mmocr载入成功')文本检测与文本提取
import torch, torchvisionimport mmcvfrom mmcv.ops import get_compiling_cuda_version, get_compiler_versionimport mmdetimport mmocrfrom mmocr.utils.ocr import MMOCR# mmocr = MMOCR(det=None, recog='SAR', device='cpu')# print('mmocr载入成功')if __name__ == '__main__': detector = MMOCR(det='TextSnake', recog='SAR', device='cuda') result = detector.readtext('demo/demo_densetext_det.jpg', output='output/demo_densetext_det.jpg')中文检测与提取
在mmocr主目录下新建文件夹/data/chineseocr/labels
进入该文件夹执行
wget http://download.openmmlab.com/mmocr/textrecog/sar/dict_printed_chinese_english_digits.txtwget http://download.openmmlab.com/mmocr/data/font.TTF下载字体和字库
import torch, torchvisionimport mmcvfrom mmcv.ops import get_compiling_cuda_version, get_compiler_versionimport mmdetimport mmocrfrom mmocr.utils.ocr import MMOCR# mmocr = MMOCR(det=None, recog='SAR', device='cpu')# print('mmocr载入成功')if __name__ == '__main__': detector = MMOCR(det='TextSnake', recog='SAR_CN', device='cuda') result = detector.readtext('demo/demo_densetext_det.jpg', output='output/demo_densetext_det.jpg')
边栏推荐
- 【RTOS训练营】课程学习方法和C语言知识(指针、结构体、函数指针、链表)和学员问题
- Django数据库增删改查
- 8 tips to adjust database performance optimization, yyds
- [calculate the number of times that one string is equal to another string]
- Rotate K strings to the left (details)
- BGP 综合实验
- 【oops-framework】网络模块WebSocket
- 【RTOS训练营】课程学习方法和结构体知识复习 + 链表知识
- ZABBIX monitoring host and resource alarm
- 【RTOS训练营】设备子系统、晚课学员提问
猜你喜欢

Unityvr -- robot arm scene 4- gifts and Christmas tree
![[RTOS training camp] program framework, preview, after-school homework and evening class questions](/img/ce/ae35acf14519f6856ba2d181ee7201.jpg)
[RTOS training camp] program framework, preview, after-school homework and evening class questions

What is the difference between request forwarding and request redirection?
![[RTOS training camp] ring buffer, at instruction, preview arrangement and evening class questions](/img/cb/de38e9f4186c4392ef8832659422ff.jpg)
[RTOS training camp] ring buffer, at instruction, preview arrangement and evening class questions

Verilog grammar basics HDL bits training 06

开放下载!《阿里巴巴 DevOps 实践手册》

The ultra comprehensive open source WinForm UI library meets all your desktop development needs!

ZABBIX monitoring host and resource alarm
![[calculate the number of times that one string is equal to another string]](/img/82/db8ed70464df46c7a700c65d208fef.png)
[calculate the number of times that one string is equal to another string]
![[zero based BLDC series] brushless DC motor control principle based on the zero crossing detection method of back EMF](/img/1d/00165635452245a4d1b557fba17c94.png)
[zero based BLDC series] brushless DC motor control principle based on the zero crossing detection method of back EMF
随机推荐
Analysis and practice of parameter parser handlermethodargumentresolver
YOLOV2 YOLO9000
【oops-framework】界面管理
Biological JC uvssa complex alleviates myc driven transcription pressure ⼒ English
Redis Command Reference Manual - key
聊聊研发团队中的“人”
JMeter/IDEA中引用jar包json-path.jar的坎坷之路
BGP 综合实验
We have no way out
Tell you the meaning of unit testing from another angle
How can a team making facial mask achieve a revenue of more than 1 million a day?
OAuth2和JWT
实战演练 | 查找在给定时间范围内购买超过 N 件商品的客户
Leetcode 笔记 20. 有效的括号
Upload local file trial version using SAP ui5 fileuploader control
Day06 MySQL knowledge points summary
[install software after computer reset] software that can search all files of the computer, the best screenshot software in the world, free music player, JDK installation, MySQL installation, installa
Verilog grammar basics HDL bits training 05
Practical exercise | find customers who buy more than n products within a given time range
hcia综合实验