Skip to content

Commit 6d2bc9f

Browse files
add d2s_train_image_shape for static train (#14312)
1 parent 6a75046 commit 6d2bc9f

File tree

7 files changed

+8
-3
lines changed

7 files changed

+8
-3
lines changed

configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Global:
1919
use_space_char: true
2020
distributed: true
2121
save_res_path: ./output/rec/predicts_ppocrv3.txt
22+
d2s_train_image_shape: [3, 48, 320]
2223

2324

2425
Optimizer:

configs/rec/PP-OCRv4/ch_PP-OCRv4_rec_hgnet.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Global:
1919
use_space_char: true
2020
distributed: true
2121
save_res_path: ./output/rec/predicts_ppocrv3.txt
22-
22+
d2s_train_image_shape: [3, 48, 320]
2323

2424
Optimizer:
2525
name: Adam

configs/rec/SVTRv2/rec_repsvtr_ch.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Global:
1919
use_space_char: true
2020
distributed: true
2121
save_res_path: ./output/rec/predicts_repsvtr.txt
22+
d2s_train_image_shape: [3, 48, 320]
2223

2324
Optimizer:
2425
name: AdamW

configs/rec/SVTRv2/rec_svtrv2_ch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Global:
1919
use_space_char: true
2020
distributed: true
2121
save_res_path: ./output/rec/predicts_svrtv2.txt
22-
22+
d2s_train_image_shape: [3, 48, 320]
2323

2424
Optimizer:
2525
name: AdamW

configs/rec/rec_latex_ocr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Global:
1818
use_space_char: False
1919
rec_char_dict_path: ppocr/utils/dict/latex_ocr_tokenizer.json
2020
save_res_path: ./output/rec/predicts_latexocr.txt
21+
d2s_train_image_shape: [1,256,256]
2122

2223
Optimizer:
2324
name: AdamW

configs/table/SLANet_ch.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Global:
2121
infer_mode: False
2222
use_sync_bn: True
2323
save_res_path: output/infer
24+
d2s_train_image_shape: [3, 488, 488]
2425

2526
Optimizer:
2627
name: Adam

ppocr/modeling/heads/rec_nrtr_head.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ def generate_square_subsequent_mask(self, sz):
355355
"""
356356
mask = paddle.zeros([sz, sz], dtype="float32")
357357
mask_inf = paddle.triu(
358-
paddle.full(shape=[sz, sz], dtype="float32", fill_value="-inf"), diagonal=1
358+
paddle.full(shape=[sz, sz], dtype="float32", fill_value=float("-inf")),
359+
diagonal=1,
359360
)
360361
mask = mask + mask_inf
361362
return mask.unsqueeze([0, 1])

0 commit comments

Comments
 (0)