![](resources/mmocr-logo.png)
📘Documentation | 🛠️Installation | 👀Model Zoo | 🆕Update News | 🤔Reporting Issues
English | 简体中文
The default branch has been switched to 1.x
from main
, and we encourage
users to migrate to the latest version, though it comes with some cost. Please refer to Migration Guide for more
details.
v1.0.0rc6 was released in 2023-03-07.
- Two new models, ABCNet v2 (inference only) and SPTS are added to
projects/
folder. - Announcing
Inferencer
, a unified inference interface in OpenMMLab for everyone's easy access and quick inference with all the pre-trained weights. Docs - Users can use test-time augmentation for text recognition tasks. Docs
- Support batch augmentation through
BatchAugSampler
, which is a technique used in SPTS. - Dataset Preparer has been refactored to allow more flexible configurations. Besides, users are now able to prepare text recognition datasets in LMDB formats. Docs
- Some textspotting datasets have been revised to enhance the correctness and consistency with the common practice.
- Potential spurious warnings from
shapely
have been eliminated.
Read Changelog for more details!
MMOCR is an open-source toolbox based on PyTorch and mmdetection for text detection, text recognition, and the corresponding downstream tasks including key information extraction. It is part of the OpenMMLab project.
The main branch works with PyTorch 1.6+.
-
Comprehensive Pipeline
The toolbox supports not only text detection and text recognition, but also their downstream tasks such as key information extraction.
-
Multiple Models
The toolbox supports a wide variety of state-of-the-art models for text detection, text recognition and key information extraction.
-
Modular Design
The modular design of MMOCR enables users to define their own optimizers, data preprocessors, and model components such as backbones, necks and heads as well as losses. Please refer to Overview for how to construct a customized model.
-
Numerous Utilities
The toolbox provides a comprehensive set of utilities which can help users assess the performance of models. It includes visualizers which allow visualization of images, ground truths as well as predicted bounding boxes, and a validation tool for evaluating checkpoints during training. It also includes data converters to demonstrate how to convert your own data to the annotation files which the toolbox supports.
-
New engines. MMOCR 1.x is based on MMEngine, which provides a general and powerful runner that allows more flexible customizations and significantly simplifies the entrypoints of high-level interfaces.
-
Unified interfaces. As a part of the OpenMMLab 2.0 projects, MMOCR 1.x unifies and refactors the interfaces and internal logics of train, testing, datasets, models, evaluation, and visualization. All the OpenMMLab 2.0 projects share the same design in those interfaces and logics to allow the emergence of multi-task/modality algorithms.
-
Cross project calling. Benefiting from the unified design, you can use the models implemented in other OpenMMLab projects, such as MMDet. We provide an example of how to use MMDetection's Mask R-CNN through
MMDetWrapper
. Check our documents for more details. More wrappers will be released in the future. -
Stronger visualization. We provide a series of useful tools which are mostly based on brand-new visualizers. As a result, it is more convenient for the users to explore the models and datasets now.
-
More documentation and tutorials. We add a bunch of documentation and tutorials to help users get started more smoothly. Read it here.
-
One-stop Dataset Preparaion. Multiple datasets are instantly ready with only one line of command, via our Dataset Preparer.
-
Embracing more
projects/
: We now introduceprojects/
folder, where some experimental features, frameworks and models can be placed, only needed to satisfy the minimum requirement on the code quality. Everyone is welcome to post their implementation of any great ideas in this folder! Learn more from our example project. -
More models. MMOCR 1.0 supports more tasks and more state-of-the-art models!
MMOCR depends on PyTorch, MMEngine, MMCV and MMDetection. Below are quick steps for installation. Please refer to Install Guide for more detailed instruction.
conda create -n open-mmlab python=3.8 pytorch=1.10 cudatoolkit=11.3 torchvision -c pytorch -y
conda activate open-mmlab
pip3 install openmim
mim install mmengine
mim install 'mmcv>=2.0.0rc1'
mim install 'mmdet>=3.0.0rc0'
git clone https://github.com/open-mmlab/mmocr.git
cd mmocr
git checkout 1.x
pip3 install -e .
Please see Quick Run for the basic usage of MMOCR.
Supported algorithms:
BackBone
- oCLIP (ECCV'2022)
Text Detection
Text Recognition
Key Information Extraction
- SDMG-R (ArXiv'2021)
Please refer to model_zoo for more details.
We appreciate all contributions to improve MMOCR. Please refer to CONTRIBUTING.md for the contributing guidelines.
MMOCR is an open-source project that is contributed by researchers and engineers from various colleges and companies. We appreciate all the contributors who implement their methods or add new features, as well as users who give valuable feedbacks. We hope the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to reimplement existing methods and develop their own new OCR methods.
If you find this project useful in your research, please consider cite:
@article{mmocr2021,
title={MMOCR: A Comprehensive Toolbox for Text Detection, Recognition and Understanding},
author={Kuang, Zhanghui and Sun, Hongbin and Li, Zhizhong and Yue, Xiaoyu and Lin, Tsui Hin and Chen, Jianyong and Wei, Huaqiang and Zhu, Yiqin and Gao, Tong and Zhang, Wenwei and Chen, Kai and Zhang, Wayne and Lin, Dahua},
journal= {arXiv preprint arXiv:2108.06543},
year={2021}
}
This project is released under the Apache 2.0 license.
- MMEngine: OpenMMLab foundational library for training deep learning models
- MMCV: OpenMMLab foundational library for computer vision.
- MIM: MIM installs OpenMMLab packages.
- MMClassification: OpenMMLab image classification toolbox and benchmark.
- MMDetection: OpenMMLab detection toolbox and benchmark.
- MMDetection3D: OpenMMLab's next-generation platform for general 3D object detection.
- MMRotate: OpenMMLab rotated object detection toolbox and benchmark.
- MMSegmentation: OpenMMLab semantic segmentation toolbox and benchmark.
- MMOCR: OpenMMLab text detection, recognition, and understanding toolbox.
- MMPose: OpenMMLab pose estimation toolbox and benchmark.
- MMHuman3D: OpenMMLab 3D human parametric model toolbox and benchmark.
- MMSelfSup: OpenMMLab self-supervised learning toolbox and benchmark.
- MMRazor: OpenMMLab model compression toolbox and benchmark.
- MMFewShot: OpenMMLab fewshot learning toolbox and benchmark.
- MMAction2: OpenMMLab's next-generation action understanding toolbox and benchmark.
- MMTracking: OpenMMLab video perception toolbox and benchmark.
- MMFlow: OpenMMLab optical flow toolbox and benchmark.
- MMEditing: OpenMMLab image and video editing toolbox.
- MMGeneration: OpenMMLab image and video generative models toolbox.
- MMDeploy: OpenMMLab model deployment framework.
Scan the QR code below to follow the OpenMMLab team's Zhihu Official Account and join the OpenMMLab team's QQ Group, or join the official communication WeChat group by adding the WeChat, or join our Slack
We will provide you with the OpenMMLab community
- 📢 share the latest core technologies of AI frameworks
- 💻 Explaining PyTorch common module source Code
- 📰 News related to the release of OpenMMLab
- 🚀 Introduction of cutting-edge algorithms developed by OpenMMLab 🏃 Get the more efficient answer and feedback
- 🔥 Provide a platform for communication with developers from all walks of life
The OpenMMLab community looks forward to your participation! 👬