Skip to content
/ mmocr Public
forked from open-mmlab/mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox

License

Notifications You must be signed in to change notification settings

Nivratti/mmocr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finetuning models

Finetuning textsnake model -- Linelevel text detector

  1. Generate dataset as per icdar2015 format. You can refer sample dataset avilable inside dataset folder and script and put it inside data folder.

  2. generate instances_training.json and instances_test.json with following command:

    python tools/data/textdet/icdar_converter.py /path/to/dataset -o /path/to/daatset -d icdar2015 --split-list training test
    
  3. Modify config file as per requirements such as dataset foldername, epoch, learning rate etc..

  4. Run command:

    python3 tools/train.py configs/textdet/textsnake/textsnake_r50_fpn_unet_1200e_ctw1500_custom.py --load-from "https://download.openmmlab.com/mmocr/textdet/textsnake/textsnake_r50_fpn_unet_1200e_ctw1500-27f65b64.pth" --work-dir "ckpt/finetuning-textsnake-v1"
    

    Note: For adding trained models of mmocr using load-from, you must give https link, for model trained by you, can specify local file path.

Important note:

Make sure dataset is valid, wrong annotations such as coordinates order affect fine-tuning, if wrong coordinates order passed it will not detect any text in inference.

Original Readme

 
OpenMMLab website HOT      OpenMMLab platform TRY IT OUT
 

Introduction

English | 简体中文

build docs codecov license PyPI Average time to resolve an issue Percentage of issues still open

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+.

Documentation: https://mmocr.readthedocs.io/en/latest/.

Major Features

  • 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 Getting Started 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.

Supported algorithms:

Text Detection
Text Recognition
Key Information Extraction
Named Entity Recognition

Please refer to model_zoo for more details.

License

This project is released under the Apache 2.0 license.

Citation

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}
}

Changelog

v0.4.1 was released in 2022-01-27.

Installation

Please refer to our Install Guide.

Get Started

Please see Getting Started for the basic usage of MMOCR.

Contributing

We appreciate all contributions to improve MMOCR. Please refer to CONTRIBUTING.md for the contributing guidelines.

Acknowledgement

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.

Projects in OpenMMLab

  • 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.

About

OpenMMLab Text Detection, Recognition and Understanding Toolbox

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Other 0.2%