Skip to content

Commit bdbc751

Browse files
authored
Renaming model files to have more information on architecture, training data and more (#7)
* add suffix of training dataset, arch & upload time to each model * update DB-IC15 benchmark results
1 parent 6a77fd6 commit bdbc751

20 files changed

+39
-20
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ A zoo for models tuned for OpenCV DNN with benchmarks on different platforms.
55
Guidelines:
66
- To clone this repo, please install [git-lfs](https://git-lfs.github.com/), run `git lfs install` and use `git lfs clone https://github.com/opencv/opencv_zoo`.
77
- To run benchmark on your hardware settings, please refer to [benchmark/README](./benchmark/README.md).
8+
- Understand model filename: `<topic>_<model_name>_<dataset>_<arch>_<upload_time>`
9+
- `<topic>`: research topics, such as `face detection` etc.
10+
- `<model_name>`: exact model names.
11+
- `<dataset>`: (Optional) the dataset that the model is trained with.
12+
- `<arch>`: (Optional) the backbone architecture of the model.
13+
- `<upload_time>`: the time when the model is uploaded, meaning the latest version of this model unless specified.
814

915
## Models & Benchmarks
1016

@@ -16,19 +22,19 @@ Hardware Setup:
1622
***Important Notes***:
1723
- The time data that shown on the following table presents the time elapsed from preprocess (resize is excluded), to a forward pass of a network, and postprocess to get final results.
1824
- The time data that shown on the following table is the median of 10 runs. Different metrics may be applied to some specific models.
25+
- Batch size is 1 for all benchmark results.
1926
- View [benchmark/config](./benchmark/config) for more details on benchmarking different models.
2027

21-
| Model | Input Size | CPU x86_64 (ms) | CPU ARM (ms) | GPU CUDA (ms)* |
28+
| Model | Input Size | CPU x86_64 (ms) | CPU ARM (ms) | GPU CUDA (ms) |
2229
|-------|------------|-----------------|--------------|---------------|
2330
| [YuNet](./models/face_detection_yunet) | 160x120 | 1.45 | 6.22 | 12.18 |
24-
| [DB](./models/text_detection_db) | 640x480 | 137.38 | 2780.78 | 220.52 |
31+
| [DB-IC15](./models/text_detection_db) | 640x480 | 142.91 | 2835.91 | 208.41 |
32+
| [DB-TD500](./models/text_detection_db) | 640x480 | 142.91 | 2841.71 | 210.51 |
2533
| [CRNN](./models/text_recognition_crnn) | 100x32 | 50.21 | 234.32 | 196.15 |
2634
| [SFace](./models/face_recognition_sface) | 112x112 | 8.65 | 99.20 | 24.88 |
2735
| [PP-ResNet](./models/image_classification_ppresnet) | 224x224 | 56.05 | 602.58 | 98.64 |
2836
| [PP-HumanSeg](./models/human_segmentation_pphumanseg) | 192x192 | 19.92 | 105.32 | 67.97 |
2937

30-
*: Batch size is 1.
31-
3238
## License
3339

3440
OpenCV Zoo is licensed under the [Apache 2.0 license](./LICENSE). Please refer to licenses of different models.

benchmark/config/face_detection_yunet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Benchmark:
1616

1717
Model:
1818
name: "YuNet"
19-
modelPath: "models/face_detection_yunet/face_detection_yunet.onnx"
19+
modelPath: "models/face_detection_yunet/face_detection_yunet_2021sep.onnx"
2020
confThreshold: 0.6
2121
nmsThreshold: 0.3
2222
topK: 5000

benchmark/config/face_recognition_sface.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Benchmark:
1414

1515
Model:
1616
name: "SFace"
17-
modelPath: "models/face_recognition_sface/face_recognition_sface.onnx"
17+
modelPath: "models/face_recognition_sface/face_recognition_sface_2021sep.onnx"

benchmark/config/human_segmentation_pphumanseg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Benchmark:
1515

1616
Model:
1717
name: "PPHumanSeg"
18-
modelPath: "models/human_segmentation_pphumanseg/human_segmentation_pphumanseg.onnx"
18+
modelPath: "models/human_segmentation_pphumanseg/human_segmentation_pphumanseg_2021oct.onnx"

benchmark/config/image_classification_ppresnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Benchmark:
1616

1717
Model:
1818
name: "PPResNet"
19-
modelPath: "models/image_classification_ppresnet/image_classification_ppresnet50.onnx"
19+
modelPath: "models/image_classification_ppresnet/image_classification_ppresnet50_2021oct.onnx"
2020
labelPath: "models/image_classification_ppresnet/imagenet_labels.txt"

benchmark/config/text_detection_db.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Benchmark:
1515

1616
Model:
1717
name: "DB"
18-
modelPath: "models/text_detection_db/text_detection_db.onnx"
18+
modelPath: "models/text_detection_db/text_detection_DB_TD500_resnet18_2021sep.onnx"
1919
binaryThreshold: 0.3
2020
polygonThreshold: 0.5
2121
maxCandidates: 200

benchmark/config/text_recognition_crnn.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Benchmark:
1414

1515
Model:
1616
name: "CRNN"
17-
modelPath: "models/text_recognition_crnn/text_recognition_crnn.onnx"
17+
modelPath: "models/text_recognition_crnn/text_recognition_CRNN_VGG_BiLSTM_CTC_2021sep.onnx"

models/face_detection_yunet/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
YuNet is a light-weight, fast and accurate face detection model, which achieves 0.834(AP_easy), 0.824(AP_medium), 0.708(AP_hard) on the WIDER Face validation set.
44

5+
Notes:
6+
- Model source: [here](https://github.com/ShiqiYu/libfacedetection.train/blob/a61a428929148171b488f024b5d6774f93cdbc13/tasks/task1/onnx/yunet.onnx).
7+
- For details on training this model, please visit https://github.com/ShiqiYu/libfacedetection.train.
8+
59
## Demo
610

711
Run the following command to try the demo:

models/face_recognition_sface/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition
44

5-
SFace is contributed by [Yaoyao Zhong](https://github.com/zhongyy/SFace). [face_recognition_sface.onnx](./face_recognition_sface.onnx) is converted from the model from https://github.com/zhongyy/SFace thanks to [Chengrui Wang](https://github.com/crywang).
6-
75
Note:
8-
- There is [a PR for OpenCV adding this model](https://github.com/opencv/opencv/pull/20422) to work with OpenCV DNN in C++ implementation.
9-
- Support 5-landmark warp for now.
10-
- `demo.py` requires [../face_detection_yunet](../face_detection_yunet) to run.
6+
- SFace is contributed by [Yaoyao Zhong](https://github.com/zhongyy/SFace).
7+
- [face_recognition_sface_2021sep.onnx](./face_recognition_sface_2021sep.onnx) is converted from the model from https://github.com/zhongyy/SFace thanks to [Chengrui Wang](https://github.com/crywang).
8+
- Support 5-landmark warpping for now (2021sep)
119

1210
## Demo
1311

12+
***NOTE***: This demo uses [../face_detection_yunet](../face_detection_yunet) as face detector, which supports 5-landmark detection for now (2021sep).
13+
1414
Run the following command to try the demo:
1515
```shell
1616
# recognize on images

models/text_detection_db/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
Real-time Scene Text Detection with Differentiable Binarization
44

5-
`text_detection_db.onnx` is trained on [TD500 dataset](http://www.iapr-tc11.org/mediawiki/index.php/MSRA_Text_Detection_500_Database_(MSRA-TD500)), which can detect both English & Chinese instances. It is obtained from [here](https://docs.opencv.org/master/d4/d43/tutorial_dnn_text_spotting.html) and renamed from `DB_TD500_resnet18.onnx`.
5+
Note:
6+
- Models source: [here](https://drive.google.com/drive/folders/1qzNCHfUJOS0NEUOIKn69eCtxdlNPpWbq).
7+
- `IC15` in the filename means the model is trained on [IC15 dataset](https://rrc.cvc.uab.es/?ch=4&com=introduction), which can detect English text instances only.
8+
- `TD500` in the filename means the model is trained on [TD500 dataset](http://www.iapr-tc11.org/mediawiki/index.php/MSRA_Text_Detection_500_Database_(MSRA-TD500)), which can detect both English & Chinese instances.
9+
- Visit https://docs.opencv.org/master/d4/d43/tutorial_dnn_text_spotting.html for more information.
610

711
## Demo
812

models/text_detection_db/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def str2bool(v):
2121

2222
parser = argparse.ArgumentParser(description='Real-time Scene Text Detection with Differentiable Binarization (https://arxiv.org/abs/1911.08947).')
2323
parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24-
parser.add_argument('--model', '-m', type=str, default='text_detection_db.onnx', help='Path to the model.')
24+
parser.add_argument('--model', '-m', type=str, default='text_detection_DB_TD500_resnet18.onnx', help='Path to the model.')
2525
parser.add_argument('--width', type=int, default=736,
2626
help='Preprocess input image by resizing to a specific width. It should be multiple by 32.')
2727
parser.add_argument('--height', type=int, default=736,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:62fce3a058ac519952062fbd2cf45bae661130ce753d2a0fc918f4776ba3a02a
3+
size 48770395

models/text_recognition_crnn/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
44

5-
`text_recognition_crnn.onnx` is trained using the code from https://github.com/zihaomu/deep-text-recognition-benchmark, which can only recognize english words. It is obtained from https://drive.google.com/drive/folders/1cTbQ3nuZG-EKWak6emD_s8_hHXWz7lAr and renamed from `CRNN_VGG_BiLSTM_CTC.onnx`. Visit https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html for more information.
5+
Note:
6+
- Model source: https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html.
7+
- For details on training this model, please visit https://github.com/zihaomu/deep-text-recognition-benchmark, which can only recognize english words.
68

79
## Demo
810

9-
***NOTE**: This demo use [text_detection_db](../text_detection_db) as text detector.
11+
***NOTE***: This demo uses [text_detection_db](../text_detection_db) as text detector.
1012

1113
Run the following command to try the demo:
1214
```shell

models/text_recognition_crnn/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def str2bool(v):
2626
parser = argparse.ArgumentParser(
2727
description="An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition (https://arxiv.org/abs/1507.05717)")
2828
parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
29-
parser.add_argument('--model', '-m', type=str, default='text_recognition_crnn.onnx', help='Path to the model.')
29+
parser.add_argument('--model', '-m', type=str, default='text_recognition_CRNN_VGG_BiLSTM_CTC.onnx', help='Path to the model.')
3030
parser.add_argument('--width', type=int, default=736,
3131
help='The width of input image being sent to the text detector.')
3232
parser.add_argument('--height', type=int, default=736,

0 commit comments

Comments
 (0)