Code Monkey home page Code Monkey logo

crnn-ctc's Introduction

ยซ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๐Ÿš€๐Ÿš€๐Ÿš€

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.

Background

This warehouse aims to better understand and apply CRNN+CTC, and currently achieves digital recognition and license plate recognition

Installation

$ pip install -r requirements.txt

Usage

Train

# 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

Eval

# 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

Predict

$ 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

Maintainers

  • zhujian - Initial work - zjykzj

Thanks

Contributing

Anyone's participation is welcome! Open an issue or submit PRs.

Small note:

License

Apache License 2.0 ยฉ 2023 zjykzj

crnn-ctc's People

Contributors

zjykzj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.