Skip to content
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

Add rec_sar #3798

Merged
merged 18 commits into from
Sep 9, 2021
Merged

Add rec_sar #3798

merged 18 commits into from
Sep 9, 2021

Conversation

andyjiang1116
Copy link
Collaborator

add recognition model SAR

@paddle-bot-old
Copy link

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Aug 24, 2021

CLA assistant check
All committers have signed the CLA.

algorithm: SAR
Transform:
Backbone:
name: ResNet31
Copy link
Collaborator

Choose a reason for hiding this comment

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

已经有resnet,复用即可

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

resnet31是作者新改的一个网络结构,和常用的不太一样

channel_first: False
- SARLabelEncode: # Class handling label
- SARRecResizeImg:
image_shape: [3, 48, 48, 160] # h:48 w:[48,160]
Copy link
Collaborator

Choose a reason for hiding this comment

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

4维的shape?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

后两维是宽度的范围,宽度是变长的

dataset:
name: SimpleDataSet
delimiter: ' '
label_file_list: ['/paddle/data/concat_data/icdar_2013_train20.txt', '/paddle/data/concat_data/icdar_2015_train20.txt', '/paddle/data/concat_data/coco_text_train20.txt', '/paddle/data/concat_data/IIIt5k_train20.txt', '/paddle/data/concat_data/SynthAdd_train.txt', '/paddle/data/concat_data/SynthText_train.txt', '/paddle/data/concat_data/Syn90k_train.txt']
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议把数据路径替换成 train_data/train_list.txt

在文档里说明训练需要用到哪些数据,有什么不同

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

那就是把这几个txt合成一个吗?

Eval:
dataset:
name: LMDBDataSet
data_dir: /paddle/data/ocr_data/evaluation/
Copy link
Collaborator

Choose a reason for hiding this comment

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

不要用绝对路径,指向相对路径,让用户可以很方便跑通,参考其他算法的配置文件。上面train同理

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

好的,我改一下

comp = re.compile('[^A-Z^a-z^0-9^\u4e00-\u9fa5]')
text = text.lower()
text = comp.sub('', text)
result_list.append((text, np.mean(conf_list)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议写成可配置,或者写在metric计算里。不要影响正常的infer结果。这样如果替换成中文训练,需要手动修改过滤条件,不是很灵活。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

之前不是说不要改metric吗?所以写在了后处理里。那可以加一个参数来控制?

]
_
`
~
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果用94字符的字典训练,精度会下降吗? 没区别的话建议修改成 character_type == "EN_symbol",不要提交重复性过高的字典。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

好的,这个前面是为了和竞品配置保持一样

LDOUBLEV
LDOUBLEV previously approved these changes Sep 7, 2021
Copy link
Collaborator

@tink2123 tink2123 left a comment

Choose a reason for hiding this comment

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

LGTM

@tink2123 tink2123 merged commit 9a44e27 into PaddlePaddle:dygraph Sep 9, 2021
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.

None yet

5 participants