Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Guidelines:
| [YuNet](./models/face_detection_yunet) | 160x120 | 1.45 | 6.22 | 12.18 |
| [DB-IC15](./models/text_detection_db) | 640x480 | 142.91 | 2835.91 | 208.41 |
| [DB-TD500](./models/text_detection_db) | 640x480 | 142.91 | 2841.71 | 210.51 |
| [CRNN](./models/text_recognition_crnn) | 100x32 | 50.21 | 234.32 | 196.15 |
| [CRNN-EN](./models/text_recognition_crnn) | 100x32 | 50.21 | 234.32 | 196.15 |
| [CRNN-CN](./models/text_recognition_crnn) | 100x32 | 73.52 | 322.16 | 239.76 |
| [SFace](./models/face_recognition_sface) | 112x112 | 8.65 | 99.20 | 24.88 |
| [PP-ResNet](./models/image_classification_ppresnet) | 224x224 | 56.05 | 602.58 | 98.64 |
| [PP-HumanSeg](./models/human_segmentation_pphumanseg) | 192x192 | 19.92 | 105.32 | 67.97 |
Expand Down
17 changes: 17 additions & 0 deletions benchmark/config/text_recognition_crnn_cn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Benchmark:
name: "Text Recognition Benchmark"
type: "Recognition"
data:
path: "benchmark/data/text"
files: ["1.jpg", "2.jpg", "3.jpg"]
metric: # 'sizes' is omitted since this model requires input of fixed size
warmup: 30
repeat: 10
reduction: "median"
backend: "default"
target: "cpu"

Model:
name: "CRNN"
modelPath: "models/text_recognition_crnn/text_recognition_CRNN_CN_2021nov.onnx"
charsetPath: "models/text_recognition_crnn/charset_3944_CN.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Benchmark:

Model:
name: "CRNN"
modelPath: "models/text_recognition_crnn/text_recognition_CRNN_VGG_BiLSTM_CTC_2021sep.onnx"
modelPath: "models/text_recognition_crnn/text_recognition_CRNN_EN_2021sep.onnx"
charsetPath: "models/text_recognition_crnn/charset_36_EN.txt"
24 changes: 20 additions & 4 deletions models/text_recognition_crnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,37 @@
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition

Note:
- Model source: https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html.
- For details on training this model, please visit https://github.com/zihaomu/deep-text-recognition-benchmark, which can only recognize english words.
- Model source:
- `text_recognition_CRNN_EN_2021sep.onnx`: https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html (CRNN_VGG_BiLSTM_CTC.onnx)
- `text_recognition_CRNN_CN_2021nov.onnx`: https://docs.opencv.org/4.5.2/d4/d43/tutorial_dnn_text_spotting.html (crnn_cs_CN.onnx)
- `text_recognition_CRNN_EN_2021sep.onnx` can detect digits (0~9) and letters (return lowercase letters a~z) (view `charset_36_EN.txt` for details).
- `text_recognition_CRNN_CN_2021nov.onnx` can detect digits (0~9), upper/lower-case letters (a~z and A~Z), some Chinese characters and some special characters (view `charset_3944_CN.txt` for details).
- For details on training this model series, please visit https://github.com/zihaomu/deep-text-recognition-benchmark.

## Demo

***NOTE***: This demo uses [text_detection_db](../text_detection_db) as text detector.
***NOTE***:
- This demo uses [text_detection_db](../text_detection_db) as text detector.
- Selected model must match with the charset:
- Try `text_recognition_CRNN_EN_2021sep.onnx` with `charset_36_EN.txt`.
- Try `text_recognition_CRNN_CN_2021sep.onnx` with `charset_3944_CN.txt`.

Run the following command to try the demo:
Run the demo detecting English:
```shell
# detect on camera input
python demo.py
# detect on an image
python demo.py --input /path/to/image
```

Run the demo detecting Chinese:
```shell
# detect on camera input
python demo.py --model text_recognition_CRNN_CN_2021nov.onnx --charset charset_3944_CN.txt
# detect on an image
python demo.py --input /path/to/image --model text_recognition_CRNN_CN_2021nov.onnx --charset charset_3944_CN.txt
```

## License

All files in this directory are licensed under [Apache 2.0 License](./LICENSE).
Expand Down
36 changes: 36 additions & 0 deletions models/text_recognition_crnn/charset_36_EN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Loading