Home

Awesome

MegReader

A project for research in text detection and recognition using PyTorch 1.2.

This project is originated from the research repo, which heavily relies on closed-source libraries, of CSG-Algorithm team of Megvii(https://megvii.com). We are in ongoing progress to transfer models into this repo gradually, released implementations are listed in Progress.

Highlights

Install

Requirements

pip install -r requirements.txt

Compile cuda ops (If needed)

cd PATH_TO_OPS

python setup.py build_ext --inplace

ops may be used:

Configuration(optional)

Edit configurations in config.py.

Training

See detailed options: python3 train.py --help

Datasets

We provide data loading implementation with annotation packed with json for quick start. Also, lmdb format data are now available too. You can refer the usage in demo. Datasets used in our recognition experiments can be downloaded from onedrive. The transform script are provide to convert json format data to lmdb.

Non-distributed

python3 train.py PATH_TO_EXPERIMENT.yaml --validate --visualize --name NAME_OF_EXPERIMENT

Following we provide some of configurations of the released recognition models:

Distributed(recommended for multi-gpu training)

python3 -m torch.distributed.launch --nproc_per_node=NUM_GPUS train.py PATH_TO_EXPERIMENT.yaml -d --validate

<!-- ### Setup your own dataset -->

Evaluating

See detailed options: python3 eval.py --help.

Keeping ratio tesing is recommended: python3 eval.py PATH_TO_EXPERIMENT.yaml --resize_mode keep_ratio

Model zoo

Trained models are comming soon.

<!-- Our trained model can be downloaded from xxx. -->

Progress

Recognition Methods

Detection Methods

End-to-end

Contributing

Contributing.md