Open-source project
hikopensource/DAVAR-Lab-OCR avatar
hikopensource/DAVAR-Lab-OCR

DAVAR-Lab-OCR: a toolbox of reimplemented OCR and document models

OCR toolbox from Davar-Lab

761 stars152 forksPythonApache-2.0

At a glance

What is it?
DAVAR-Lab-OCR collects reimplementations of published detection, recognition, spotting, video and document understanding models behind a common mmdetection and mmcv interface, so researchers can compare them in one framework. It ships no trained weights and pins an old framework generation, so it is a study bench rather than a deployment library.
Who is it for?
DAVAR-Lab-OCR suits a researcher or student who wants several published OCR and document understanding models running in one mmdetection-based framework to reproduce a paper or run ablation comparisons, and it is a poor fit for a production pipeline that needs maintained model implementations, current framework versions, or pretrained weights.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 120 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A collection of reimplementations, not a new OCR engine

DAVAR-Lab-OCR is the open source OCR repository of DAVAR Lab at Hikvision Research Institute in China. The project states plainly why it exists: the code is maintained to release implementations of recent academic publications, along with re-implementations of previously popular OCR algorithms and modules, and some ablation experiment comparisons are provided for better reproduction.

That framing sets expectations correctly. There is no single model here and no pipeline you install and run. What there is, is a shelf of algorithms, each in its own directory, each of which you can train and evaluate with the same underlying framework.

The breadth is the point. Text detection covers EAST, Mask RCNN and Text Perceptron Det. Text recognition covers Attention, CRNN, ACE, SPIN and RF-Learning. Text spotting adds Mask RCNN E2E, Text Perceptron E2E, MANGO and DLD, and video text spotting adds YORO. The document side is broader still: Chargrid and TRIE for information extraction, LGPMA for table recognition, CTUNet for table understanding, VSR for layout recognition, GCN-PN for reading order detection, and two named entity recognition variants, a BERT-based one with CRF, Span or Softmax heads, and a BiLSTM+CRF one.

A short paper introducing DavarOCR is on arXiv, and the project asks users to cite it, with a BibTeX entry pointing at an ACM MM publication titled DavarOCR: A Toolbox for OCR and Multi-Modal Document Understanding.

Everything is re-implemented on top of mmdetection 2.11.0 and mmcv 1.3.4

The mechanism behind the whole toolbox is a company policy constraint, and it is stated in the readme rather than hidden. Because of the policy limits of the company, all of the codes were re-implemented based on the open source frameworks mmdetection-2.11.0 and mmcv-1.3.4 from open-mmlab, and the code architecture also refers to mmocr, which the project says means the two frameworks can be well compatible with each other.

The practical effect is that every model in the list is expressed in the mmdetection configuration and runner idiom rather than in its original paper's framework. A detector is a config plus a module, a recogniser is a config plus a head, and training and evaluation go through mmcv's runner. That uniformity is what makes the ablation comparisons possible, because two models from different years and different authors can be trained with the same harness.

It also means the toolbox inherits the framework's version coupling. mmdetection 2.11.0 and mmcv 1.3.4 are specific generations, not the current ones, and the architecture borrow from mmocr means the dependency set has to be resolved in a particular way. Anyone planning to run this today is running a 2021 generation of the ecosystem, which is workable but no longer frictionless.

The repository layout reflects the same structure: a davarocr/ package directory holding the code, a demo/ tree with one directory per algorithm group, tools/ for scripts, requirements/ split into several files, setup.py, setup.sh and a docs/ folder holding the FAQ and the changelog.

Installing: a clone and one script that pulls mmdetection and mmcv-full

The installation is three commands, and the third one does the work:

shell
git clone https://github.com/hikopensource/DAVAR-Lab-OCR.git
cd DAVAR-Lab-OCR/
bash setup.sh

The readme states that this script will automatically download and install mmdetection and mmcv-full, and that you can also install them manually following the official instructions of the upstream projects. The manual route is worth knowing about, because the script installs a specific mmcv build, and mmcv-full is a compiled extension whose build depends on the local CUDA and PyTorch versions.

The package requirements are split across several files rather than one list. The top-level requirements.txt is a set of includes:

shell
-r requirements/build.txt
-r requirements/optional.txt
-r requirements/runtime.txt
-r requirements/tests.txt
-r requirements/davarocr_extra.txt

The setup.py reads requirements.txt, parses out the version specifiers so the install requirements are not pinned, and reads the version from davarocr/version.py rather than duplicating it. It also reads the readme for the long description and uses find_packages to pick up the package directories.

After installation, the guidance is to go to the specific algorithm's directory to see more details. That is the practical shape of this toolbox: every algorithm carries its own config files and instructions, and there is no single entry point that runs everything.

The lowest compatible environment, and the OpenCV C++ trap

The readme points at the mmdetection documentation for the recommended environment and then gives a lowest compatible table, which is the more useful of the two for anyone setting this up:

| Basic Env | version | | :---------- | ------- | | Python | 3.6+ | | cuda | 10.0+ | | cudnn | 7.6.3+ | | pytorch | 1.3.0+ | | torchvision | 0.4.1+ | | opencv | 3.0.0+ |

The floors are old. CUDA 10.0, cuDNN 7.6.3 and PyTorch 1.3.0 describe a 2019 to 2020 era machine. A current GPU host with a recent driver will generally have a much newer CUDA runtime installed, and older PyTorch builds pinned to old CUDA versions are where installation breaks first. The project anticipates this, pointing at a FAQ for problems in the installation and research process.

The other trap is specific and worth repeating. For some of the algorithms, EAST and Text Perceptron, the C++ version of opencv is required. If you do not need those algorithms, the readme says you could temporarily ignore the error about opencv.hpp or remove the related code temporarily. That is a small but honest admission that a single dependency problem blocks the whole install, and that the escape is to disable part of the toolbox rather than fix the environment.

Where this toolbox is the wrong tool

There are three cases where DAVAR-Lab-OCR is the wrong choice, and they are worth being direct about.

The first is production deployment. This is a research codebase released to make papers reproducible, with a directory of model configurations rather than a supported package with a stable public API, and the installation path depends on a specific old framework generation that upstream continues to move past. A team shipping OCR in a product needs something with a maintained release line and a support commitment, and this is not that.

The second is pretrained weights. The readme lists algorithms and demos but does not mention any released checkpoints, and the setup instructions do not fetch one. Expect to train from scratch or to source weights yourself, which is a research budget question rather than a tooling question.

The third is the current ecosystem. mmdetection 2.11.0 and mmcv 1.3.4 are from the mmcv 1.x generation, while the ecosystem has moved to mmcv 2.x with a different configuration format and API surface. A team that wants to work with current mmdetection code will not be able to drop these models in without the porting work the toolbox itself was avoiding.

The paper is the honest alternative for anyone who only needs one algorithm. If you want MANGO or DLD or CTUNet specifically, the original publications have their own reference implementations, and the value here is the common harness for comparison rather than the models themselves.

Licence, maintenance and how the code was produced

The project is released under the Apache 2.0 licence, with the LICENSE file at the repository root. The copyright notice is more specific than the licence: the copyright of corresponding contributions of the implementations belongs to Davar-Lab, Hikvision Research Institute, China, and other code from open source repositories follows the original distribution licences. That split follows from the re-implementation approach, since the frameworks and components taken from open-mmlab keep their own terms, and the DAVAR-Lab contributions are under Apache 2.0. This is a description of how the licensing is arranged rather than legal advice.

On maintenance, the facts are worth stating plainly. The repository is not archived, and the last push was on 2026-06-29. The releases tell a different story: v0.6.0 on 2022-07-15, v0.5.0 on 2022-05-09 and v0.4.0 on 2021-12-31, and the changelog records DavarOCR v0.6.0 as released on 13/07/2022 with details in docs/Changelog.md.

So the code is still being touched while the last tagged release is more than four years old. For a research toolbox that is a reasonable shape, since a release has to clear packaging and compatibility work that a research fix does not, and for a reader it means the tagged version and the head of the branch can differ.

The project also points to a FAQ at docs/FAQ.md for problems encountered during installation and research, and to the DAVAR-Lab site for news, with a contact address given for questions and suggestions.

Editorial conclusion

DAVAR-Lab-OCR suits a researcher or student who wants several published OCR and document understanding models running in one mmdetection-based framework to reproduce a paper or run ablation comparisons, and it is a poor fit for a production pipeline that needs maintained model implementations, current framework versions, or pretrained weights. Before using it, read the FAQ in docs/FAQ.md for known installation problems, check that your CUDA, cuDNN and PyTorch versions satisfy the lowest compatible environment table, and confirm the specific algorithm directory documents the data and checkpoint it expects.

Frequently asked questions

What is DAVAR-Lab-OCR and who maintains it?

It is the open source OCR toolbox of DAVAR Lab at Hikvision Research Institute in China, holding reimplementations of recent academic publications plus re-implementations of popular OCR algorithms. The copyright of the contributions belongs to Davar-Lab, and the project is released under the Apache 2.0 licence.

How do I install DAVAR-Lab-OCR?

Clone the repository, enter the directory and run bash setup.sh, which automatically downloads and installs mmdetection and mmcv-full. You can also install those two frameworks manually following their own instructions, which matters when the local CUDA and PyTorch versions do not match the ones the script expects.

Which OCR algorithms does the toolbox include?

Text detection covers EAST, Mask RCNN and Text Perceptron Det, text recognition covers Attention, CRNN, ACE, SPIN and RF-Learning, and text spotting covers Mask RCNN E2E, Text Perceptron E2E, MANGO and DLD, with YORO for video text spotting. It also includes Chargrid and TRIE, LGPMA, CTUNet, VSR, GCN-PN and two named entity recognition variants.

What environment does DAVAR-Lab-OCR need?

The lowest compatible environment given in the readme is Python 3.6+, CUDA 10.0+, cuDNN 7.6.3+, PyTorch 1.3.0+, torchvision 0.4.1+ and opencv 3.0.0+, with the recommended environment taken from the mmdetection documentation. EAST and Text Perceptron additionally need the C++ version of opencv, and the readme notes the error about opencv.hpp can be ignored if you do not need those algorithms.

Are pretrained model weights included with DAVAR-Lab-OCR?

The readme does not mention released checkpoints and the installation instructions do not fetch any, so plan to train from scratch or obtain weights separately. The project does provide a paper on arXiv, a BibTeX citation entry, and a FAQ at docs/FAQ.md covering installation and research problems.

Official sources

  1. hikopensource/DAVAR-Lab-OCR on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/hikopensource-davar-lab-ocr.svg)](https://hysenlabs.com/projects/hikopensource-davar-lab-ocr)

Was this useful?