-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add rec_sar #3798
Conversation
Thanks for your contribution! |
algorithm: SAR | ||
Transform: | ||
Backbone: | ||
name: ResNet31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经有resnet,复用即可
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4维的shape?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后两维是宽度的范围,宽度是变长的
configs/rec/rec_r31_sar.yml
Outdated
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'] |
There was a problem hiding this comment.
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
在文档里说明训练需要用到哪些数据,有什么不同
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就是把这几个txt合成一个吗?
configs/rec/rec_r31_sar.yml
Outdated
Eval: | ||
dataset: | ||
name: LMDBDataSet | ||
data_dir: /paddle/data/ocr_data/evaluation/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要用绝对路径,指向相对路径,让用户可以很方便跑通,参考其他算法的配置文件。上面train同理
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议写成可配置,或者写在metric计算里。不要影响正常的infer结果。这样如果替换成中文训练,需要手动修改过滤条件,不是很灵活。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前不是说不要改metric吗?所以写在了后处理里。那可以加一个参数来控制?
ppocr/utils/dict90.txt
Outdated
] | ||
_ | ||
` | ||
~ |
There was a problem hiding this comment.
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",不要提交重复性过高的字典。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,这个前面是为了和竞品配置保持一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
add recognition model SAR