Skip to content

Commit

Permalink
revert eval mode (PaddlePaddle#9843)
Browse files Browse the repository at this point in the history
* revert eval mode

* update hgnet config
  • Loading branch information
tink2123 authored May 4, 2023
1 parent b306681 commit 7e0c8ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,9 @@ Eval:
img_mode: BGR
channel_first: false
- MultiLabelEncode:
max_text_length: 100
character_dict_path: ppocr/utils/ppocr_keys_v1.txt
use_space_char: True
gtc_encode: NRTRLabelEncode
- RecResizeImg:
image_shape: [3, 48, 320]
eval_mode: True
- KeepKeys:
keep_keys:
- image
Expand All @@ -138,5 +134,5 @@ Eval:
loader:
shuffle: false
drop_last: false
batch_size_per_card: 1
batch_size_per_card: 128
num_workers: 4
10 changes: 3 additions & 7 deletions configs/rec/PP-OCRv4/ch_PP-OCRv4_rec_hgnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Train:
name: MultiScaleDataSet
ds_width: false
data_dir: ./train_data/
ext_op_transform_idx: 1
label_file_list:
- ./train_data/train_list.txt
transforms:
Expand All @@ -99,16 +100,15 @@ Train:
sampler:
name: MultiScaleSampler
scales: [[320, 32], [320, 48], [320, 64]]
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: &bs 128
fix_bs: false
divided_factor: [8, 16] # w, h
is_training: True
loader:
shuffle: true
batch_size_per_card: 128
batch_size_per_card: *bs
drop_last: true
num_workers: 4
num_workers: 8
Eval:
dataset:
name: SimpleDataSet
Expand All @@ -120,13 +120,9 @@ Eval:
img_mode: BGR
channel_first: false
- MultiLabelEncode:
max_text_length: 100
character_dict_path: ppocr/utils/ppocr_keys_v1.txt
use_space_char: True
gtc_encode: NRTRLabelEncode
- RecResizeImg:
image_shape: [3, 48, 320]
eval_mode: True
- KeepKeys:
keep_keys:
- image
Expand Down
2 changes: 1 addition & 1 deletion ppocr/data/imaug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def create_operators(op_param_list, global_config=None):
dict) and len(operator) == 1, "yaml format error"
op_name = list(operator)[0]
param = {} if operator[op_name] is None else operator[op_name]
if global_config is not None and "max_text_length" not in param:
if global_config is not None:
param.update(global_config)
op = eval(op_name)(**param)
ops.append(op)
Expand Down

0 comments on commit 7e0c8ae

Please sign in to comment.