RuijieJ / pren

Code for "Primitive Representation Learning for Scene Text Recognition" (CVPR 2021)
Apache License 2.0
81 stars 17 forks source link

最大长度问题 #1

Closed jiangxiluning closed 3 years ago

jiangxiluning commented 3 years ago

https://github.com/RuijieJ/pren/blob/438fa150970af478ecd59290850a16730ed1b734/data/dataset.py#L61

最大长度写死,导致修改配置文件最大长度,会使得训练报错

liudatutu commented 3 years ago

@jiangxiluning 根据自己数据集,适当调整就好了

RuijieJ commented 3 years ago

@jiangxiluning 可以手动修改一下这里的数值和config里保持一致,或者在dataset.py里import一下configs。不过根据经验二三十个字以上很难识别对了。改进对长文本的性能也是之后一个目标。

liudatutu commented 3 years ago

@RuijieJ 感谢大佬开源代码,想问一下对于训练图片的resize到固定大小,是直接resize还是加padding的好啊,要是用padding方式,填充的像素值又为多少合适呢?

RuijieJ commented 3 years ago

@liudatutu 根据ASTER论文里的结果,英文场景文字图像直接resize到固定大小效果更好。最近两年的论文里固定大小和padding的都有,个人觉得padding加0就行。不过如果模型里用了transformer,图像padding之后要对应加attention mask,稍微麻烦点。

RuijieJ commented 3 years ago

As there seem to be no further problem, I'm going to close this issue.