Skip to content

Add SVTR Tiny model #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 25, 2023
Merged

Add SVTR Tiny model #308

merged 9 commits into from
May 25, 2023

Conversation

zhtmike
Copy link
Collaborator

@zhtmike zhtmike commented May 23, 2023

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

(Write your motivation for proposed changes here.)

Test Plan

(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@zhtmike
Copy link
Collaborator Author

zhtmike commented May 23, 2023

部分data transform目前跟本身有的会有重叠,会在 #300 重构。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result table should align center.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.



@register_backbone
def rec_svtr(pretrained: bool = True, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the pretrained supposed to be False by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有一个通用的 pretrained weight,所有一般是靠url提供。

如要重现报告的评估结果,您可以:
- 方法 1:对所有单个数据集重复评估步骤:CUTE80、IC03_860、IC03_867、IC13_857、IC131015、IC15_1811、IC15_2077、IIIT5k_3000、SVT、SVTP。然后取平均分。

- 方法 2:将所有基准数据集文件夹放在同一目录下,例如`评估/`。并使用脚本`tools/benchmarking/multi_dataset_eval.py`。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 方法 2:将所有基准数据集文件夹放在同一目录下,例如`评估/`。并使用脚本`tools/benchmarking/multi_dataset_eval.py`
- 方法 2:将所有基准数据集文件夹放在同一目录下,例如`evaluation/`。并使用脚本`tools/benchmarking/multi_dataset_eval.py`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Mindocr内置了一部分字典,均放在了 `mindocr/utils/dict/` 位置,可选择合适的字典使用。

- `en_dict.txt` 是一个包含94个字符的英文字典,其中有数字,常用符号以及大小写的英文字母。
- `ch_dict.txt` 是一个包含6623个字符的中文字典,其中有常用的繁简体中文,数字,常用符号以及大小写的英文字母
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `ch_dict.txt` 是一个包含6623个字符的中文字典,其中有常用的繁简体中文,数字,常用符号以及大小写的英文字母
- `ch_dict.txt` 是一个包含6623个字符的中文字典,其中有常用的繁简体中文,数字,常用符号以及大小写的英文字母

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@@ -37,21 +37,25 @@ Table Format:

According to our experiments, the evaluation results on public benchmark datasets (IC03, IC13, IC15, IIIT, SVT, SVTP, CUTE) is as follow:

<div align="center">

| **Model** | **Context** | **Backbone** | **Avg Accuracy** | **Train T.** | **Recipe** | **Download** |
| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |
| CRNN (ours) | D910x8-MS1.8-G | VGG7 | 82.03% | 2445 s/epoch | [yaml](https://github.com/mindspore-lab/mindocr/blob/main/configs/rec/crnn/crnn_vgg7.yaml) | [ckpt](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_vgg7-ea7e996c.ckpt) \| [mindir](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_vgg7-ea7e996c-3a19e349.mindir) |
| CRNN (ours) | D910x8-MS1.8-G | ResNet34_vd | 84.45% | 2118 s/epoch | [yaml](https://github.com/mindspore-lab/mindocr/blob/main/configs/rec/crnn/crnn_resnet34.yaml) | [ckpt](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_resnet34-83f37f07.ckpt) \| [mindir](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_resnet34-83f37f07-2f016384.mindir) |
| CRNN (PaddleOCR) | - | ResNet34_vd | 83.99% | - | - | - |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crnn rare svtr的中英文文档都删去与paddleocr的对比。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -37,21 +37,25 @@ Table Format:

According to our experiments, the evaluation results on public benchmark datasets (IC03, IC13, IC15, IIIT, SVT, SVTP, CUTE) is as follow:

<div align="center">

| **Model** | **Context** | **Backbone** | **Avg Accuracy** | **Train T.** | **Recipe** | **Download** |
| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |
| CRNN (ours) | D910x8-MS1.8-G | VGG7 | 82.03% | 2445 s/epoch | [yaml](https://github.com/mindspore-lab/mindocr/blob/main/configs/rec/crnn/crnn_vgg7.yaml) | [ckpt](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_vgg7-ea7e996c.ckpt) \| [mindir](https://download.mindspore.cn/toolkits/mindocr/crnn/crnn_vgg7-ea7e996c-3a19e349.mindir) |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删去ours,crnn rare svtr中英文文档同理。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@HaoyangLee HaoyangLee merged commit 1444774 into mindspore-lab:main May 25, 2023
@zhtmike zhtmike deleted the svtr branch June 27, 2023 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants