当前位置:网站首页>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')
边栏推荐
- Practical exercise | find customers who buy more than n products within a given time range
- 【RTOS训练营】GPIO知识和预习安排 + 晚课提问
- pip install --upgrade can‘t find Rust compiler
- 参数解析器HandlerMethodArgumentResolver分析与实战
- DC-6 -- vulnhub range
- The difference between TCP and UDP
- Processes and threads
- [oops framework] random number generation management
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
- SQL statement exercise
猜你喜欢

Tell you the meaning of unit testing from another angle

【RTOS训练营】任务调度(续)、任务礼让、调度总结、队列和晚课提问

How can a team making facial mask achieve a revenue of more than 1 million a day?

超全的开源Winform UI库,满足你的一切桌面开发需求!

Save unhappiness! My robot psychologist; KPI tracking of machine learning; Pytorch implementation of Yolo V7; Li Hang's new book "machine learning methods" open trial | showmeai Information Daily

【RTOS训练营】设备子系统、晚课学员提问

Verilog grammar basics HDL bits training 05

With data-driven management transformation, the first year of science and technology was at the right time

我们没有退路了

Verilog grammar basics HDL bits training 06
随机推荐
Verilog grammar basics HDL bits training 05
HCIP第十二天
南姐的糗事
Crawler small operation
hcia综合实验
C # from entry to mastery (III)
HCIA comprehensive experiment
The ultra comprehensive open source WinForm UI library meets all your desktop development needs!
[RTOS training camp] equipment subsystem, questions of evening students
Seretod2022 track1 code analysis - task-based dialogue system challenge for semi supervised and reinforcement learning
P4047 [jsoi2010] tribal Division
Django数据库增删改查
Jupyter changes the main interface and imports the dataset
ASP.NET Core配置
以数据驱动管理转型,元年科技正当时
YOLOV3
超全的开源Winform UI库,满足你的一切桌面开发需求!
Master MySQL in an article
Talk about "people" in the R & D team
Cnosdb Nirvana Rebirth: abandon go and fully embrace rust