-
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 satrn #8433
add satrn #8433
Conversation
Thanks for your contribution! |
数据集: 模型训练: 模型验证: 模型测试: 存在问题: |
satrn_head.py的526行修改为:for step in range(0, paddle.to_tensor(self.max_seq_len)): |
satrn 和 nrtr是同类型的识别模型,如果可以的话尽量复用nrtr的代码,例如shallow cnn可以写到MTB中,attention和encoder layer和decoder layer 如果差别不大的话也可以复用nrtr的代码 |
init_target_seq[:, 0] = self.start_idx | ||
|
||
outputs = [] | ||
for step in range(0, self.max_seq_len): |
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.
for step in range(0, paddle.to_tensor(self.max_seq_len)):
导出模型: |
configs/rec/rec_satrn.yml
Outdated
epoch_num: 5 | ||
log_smooth_window: 20 | ||
print_batch_step: 50 | ||
save_model_dir: ../work_dir/ppocr/satrn_branch/rec_satrn/ |
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.
save_model_dir最好与其他方法修改一致:./output/rec/rec_satrn
configs/rec/rec_satrn.yml
Outdated
Train: | ||
dataset: | ||
name: LMDBDataSet | ||
data_dir: /data/Dataset/OCR_Rec/visual_data/rfl_dataset2/training |
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/data_lmdb_release/training/
configs/rec/rec_satrn.yml
Outdated
Eval: | ||
dataset: | ||
name: LMDBDataSet | ||
data_dir: /data/Dataset/OCR_Rec/visual_data/rfl_dataset2/evaluation_academic |
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/data_lmdb_release/evaluation/
ppocr/data/imaug/rec_img_aug.py
Outdated
@@ -465,6 +465,21 @@ def __call__(self, data): | |||
return data | |||
|
|||
|
|||
class SATRNRecResizeImg(object): | |||
def __init__(self, image_shape, padding=True, **kwargs): |
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.
如果没用到SATRNRecResizeImg的话可以删除
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
if mask is not None: | ||
attn = masked_fill(attn, mask == 0, -1e9) | ||
# attn = attn.masked_fill(mask == 0, float('-inf')) | ||
# attn += mask |
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.
todo:不必要的注释可以删除
需要补充文档并接入TIPC |
复现论文:On Recognizing Texts of Arbitrary Shapes with 2D Self-Attention
参考代码:https://github.com/open-mmlab/mmocr/blob/1.x/configs/textrecog/satrn/README.md