mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-11-02 10:49:19 +00:00
add d2s_train_image_shape for static train (#14312)
This commit is contained in:
parent
6a75046607
commit
6d2bc9f573
@ -19,6 +19,7 @@ Global:
|
||||
use_space_char: true
|
||||
distributed: true
|
||||
save_res_path: ./output/rec/predicts_ppocrv3.txt
|
||||
d2s_train_image_shape: [3, 48, 320]
|
||||
|
||||
|
||||
Optimizer:
|
||||
|
||||
@ -19,7 +19,7 @@ Global:
|
||||
use_space_char: true
|
||||
distributed: true
|
||||
save_res_path: ./output/rec/predicts_ppocrv3.txt
|
||||
|
||||
d2s_train_image_shape: [3, 48, 320]
|
||||
|
||||
Optimizer:
|
||||
name: Adam
|
||||
|
||||
@ -19,6 +19,7 @@ Global:
|
||||
use_space_char: true
|
||||
distributed: true
|
||||
save_res_path: ./output/rec/predicts_repsvtr.txt
|
||||
d2s_train_image_shape: [3, 48, 320]
|
||||
|
||||
Optimizer:
|
||||
name: AdamW
|
||||
|
||||
@ -19,7 +19,7 @@ Global:
|
||||
use_space_char: true
|
||||
distributed: true
|
||||
save_res_path: ./output/rec/predicts_svrtv2.txt
|
||||
|
||||
d2s_train_image_shape: [3, 48, 320]
|
||||
|
||||
Optimizer:
|
||||
name: AdamW
|
||||
|
||||
@ -18,6 +18,7 @@ Global:
|
||||
use_space_char: False
|
||||
rec_char_dict_path: ppocr/utils/dict/latex_ocr_tokenizer.json
|
||||
save_res_path: ./output/rec/predicts_latexocr.txt
|
||||
d2s_train_image_shape: [1,256,256]
|
||||
|
||||
Optimizer:
|
||||
name: AdamW
|
||||
|
||||
@ -21,6 +21,7 @@ Global:
|
||||
infer_mode: False
|
||||
use_sync_bn: True
|
||||
save_res_path: output/infer
|
||||
d2s_train_image_shape: [3, 488, 488]
|
||||
|
||||
Optimizer:
|
||||
name: Adam
|
||||
|
||||
@ -355,7 +355,8 @@ class Transformer(nn.Layer):
|
||||
"""
|
||||
mask = paddle.zeros([sz, sz], dtype="float32")
|
||||
mask_inf = paddle.triu(
|
||||
paddle.full(shape=[sz, sz], dtype="float32", fill_value="-inf"), diagonal=1
|
||||
paddle.full(shape=[sz, sz], dtype="float32", fill_value=float("-inf")),
|
||||
diagonal=1,
|
||||
)
|
||||
mask = mask + mask_inf
|
||||
return mask.unsqueeze([0, 1])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user