ยซcrnn-ctcยป implemented CRNN+CTC
Model | ARCH | Model Size (MB) | EMNIST Accuracy (%) | Training Data | Testing Data |
---|---|---|---|---|---|
CRNN | CONV+GRU | 31 | 98.546 | 100,000 | 5,000 |
CRNN_Tiny | CONV+GRU | 1.7 | 98.396 | 100,000 | 5,000 |
Model | ARCH | Model Size (MB) | ChineseLicensePlate Accuracy (%) | Training Data | Testing Data |
---|---|---|---|---|---|
CRNN | CONV+GRU | 58 | 82.379 | 269,621 | 149,002 |
CRNN_Tiny | CONV+GRU | 4 | 76.222 | 269,621 | 149,002 |
- Table of Contents
- News๐๐๐
- Background
- Installation
- Usage
- Maintainers
- Thanks
- Contributing
- License
Version | Release Date | Major Updates |
---|---|---|
v1.0.0 | 2024/08/04 | Optimize the CRNN architecture while achieving super lightweight CRNN_Tiny. In addition, all training scripts support mixed precision training. |
v0.3.0 | 2024/08/03 | Implement models CRNN_LSTM and CRNN_GRU on datasets EMNIST and ChineseLicensePlate. |
v0.2.0 | 2023/10/11 | Support training/evaluation/prediction of CRNN+CTC based on license plate. |
v0.1.0 | 2023/10/10 | Support training/evaluation/prediction of CRNN+CTC based on EMNIST digital characters. |
This warehouse aims to better understand and apply CRNN+CTC, and currently achieves digital recognition and license plate recognition
$ pip install -r requirements.txt
- ChineseLicensePlate: Baidu Drive(ad7l)
# EMNIST
$ python3 train_emnist.py ../datasets/emnist/ ./runs/crnn-emnist-b512/ --batch-size 512 --device 0 --not-tiny
# Plate
$ python3 train_plate.py ../datasets/chinese_license_plate/recog/ ./runs/crnn-plate-b512/ --batch-size 512 --device 0 --not-tiny
# EMNIST
$ CUDA_VISIBLE_DEVICES=0 python eval_emnist.py runs/crnn-emnist-b512-e100.pth ../datasets/emnist/ --not-tiny
args: Namespace(not_tiny=True, pretrained='runs/crnn-emnist-b512-e100.pth', use_lstm=False, val_root='../datasets/emnist/')
Loading CRNN pretrained: runs/crnn-emnist-b512-e100.pth
Batch:1562 ACC:100.000: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 1563/1563 [00:22<00:00, 69.08it/s]
ACC:98.546
# Plate
$ CUDA_VISIBLE_DEVICES=0 python3 eval_plate.py ./runs/crnn-plate-b512-e100.pth ../datasets/chinese_license_plate/recog/ --not-tiny
args: Namespace(not_tiny=True, only_ccpd2019=False, only_ccpd2020=False, only_others=False, pretrained='./runs/crnn-plate-b512-e100.pth', use_lstm=False, val_root='../datasets/chinese_license_plate/recog/')
Loading CRNN pretrained: ./runs/crnn-plate-b512-e100.pth
Load test data: 149002
Batch:4656 ACC:100.000: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 4657/4657 [00:56<00:00, 83.05it/s]
ACC:82.379
$ CUDA_VISIBLE_DEVICES=0 python predict_emnist.py runs/crnn-emnist-b512-e100.pth ../datasets/emnist/ ./runs/predict/emnist/ --not-tiny
args: Namespace(not_tiny=True, pretrained='runs/crnn-emnist-b512-e100.pth', save_dir='./runs/predict/emnist/', use_lstm=False, val_root='../datasets/emnist/')
Loading CRNN pretrained: runs/crnn-emnist-b512-e100.pth
Label: [4 5 9 0 1] Pred: [4 5 9 0 1]
Label: [5 9 5 6 1] Pred: [5 9 5 6 1]
Label: [1 6 0 8 3] Pred: [1 6 0 8 3]
Label: [9 1 7 2 4] Pred: [9 1 7 2 4]
Label: [2 8 9 6 3] Pred: [2 8 9 6 3]
Label: [0 6 9 8 2] Pred: [0 6 9 8 2]
$ python predict_plate.py ./runs/crnn-plate-b512-e100.pth ./assets/plate/ๅฎA87J92_0.jpg runs/predict/plate/ --not-tiny
args: Namespace(image_path='./assets/plate/ๅฎA87J92_0.jpg', not_tiny=True, pretrained='./runs/crnn-plate-b512-e100.pth', save_dir='runs/predict/plate/', use_lstm=False)
Loading CRNN pretrained: ./runs/crnn-plate-b512-e100.pth
Pred: ๅฎAยท87J92
Save to runs/predict/plate/plate_ๅฎA87J92_0.jpg
$ python predict_plate.py ./runs/crnn-plate-b512-e100.pth ./assets/plate/ๅทA3X7J1_0.jpg runs/predict/plate/ --not-tiny
args: Namespace(image_path='./assets/plate/ๅทA3X7J1_0.jpg', not_tiny=True, pretrained='./runs/crnn-plate-b512-e100.pth', save_dir='runs/predict/plate/', use_lstm=False)
Loading CRNN pretrained: ./runs/crnn-plate-b512-e100.pth
Pred: ๅทAยท3X7J1
Save to runs/predict/plate/plate_ๅทA3X7J1_0.jpg
- zhujian - Initial work - zjykzj
Anyone's participation is welcome! Open an issue or submit PRs.
Small note:
- Git submission specifications should be complied with Conventional Commits
- If versioned, please conform to the Semantic Versioning 2.0.0 specification
- If editing the README, please conform to the standard-readme specification.
Apache License 2.0 ยฉ 2023 zjykzj