未验证 提交 0e9c6630 编写于 作者: H huangjun12 提交者: GitHub

fix det v4 bug in dynamic ratio (#9874)

* fix set bug

* refine 960 to 640

* fix details

* add epoch num

* add rep export

* use db head
上级 096fd271
Global:
debug: false
use_gpu: true
epoch_num: 500
epoch_num: &epoch_num 500
log_smooth_window: 20
print_batch_step: 100
save_model_dir: ./output/ch_PP-OCRv3_mv3_cbnlocal_shrink/
save_model_dir: ./output/ch_PP-OCRv4
save_epoch_step: 10
eval_batch_step:
- 0
......@@ -31,9 +31,8 @@ Architecture:
out_channels: 96
shortcut: True
Head:
name: PFHeadLocal
name: DBHead
k: 50
mode: "small"
Loss:
name: DBLoss
......@@ -96,19 +95,19 @@ Train:
- 3
- EastRandomCropData:
size:
- 960
- 960
- 640
- 640
max_tries: 50
keep_ratio: true
- MakeBorderMap:
shrink_ratio: 0.4
thresh_min: 0.3
thresh_max: 0.7
total_epoch: 500
total_epoch: *epoch_num
- MakeShrinkMap:
shrink_ratio: 0.4
min_text_size: 8
total_epoch: 500
total_epoch: *epoch_num
- NormalizeImage:
scale: 1./255.
mean:
......
Global:
debug: false
use_gpu: true
epoch_num: 500
epoch_num: &epoch_num 500
log_smooth_window: 20
print_batch_step: 100
save_model_dir: ./output/ch_PP-OCRv3_mv3_cbnlocal_shrink/
save_model_dir: ./output/ch_PP-OCRv4
save_epoch_step: 10
eval_batch_step:
- 0
......@@ -96,19 +96,19 @@ Train:
- 3
- EastRandomCropData:
size:
- 960
- 960
- 640
- 640
max_tries: 50
keep_ratio: true
- MakeBorderMap:
shrink_ratio: 0.4
thresh_min: 0.3
thresh_max: 0.7
total_epoch: 500
total_epoch: *epoch_num
- MakeShrinkMap:
shrink_ratio: 0.4
min_text_size: 8
total_epoch: 500
total_epoch: *epoch_num
- NormalizeImage:
scale: 1./255.
mean:
......
......@@ -51,22 +51,22 @@ class SimpleDataSet(Dataset):
if self.mode == "train" and self.do_shuffle:
self.shuffle_data_random()
self.set_epoch_as_seed(self.seed)
self.set_epoch_as_seed(self.seed, dataset_config)
self.ops = create_operators(dataset_config['transforms'], global_config)
self.ext_op_transform_idx = dataset_config.get("ext_op_transform_idx",
2)
self.need_reset = True in [x < 1 for x in ratio_list]
def set_epoch_as_seed(self, seed):
if self.mode is 'train':
def set_epoch_as_seed(self, seed, dataset_config):
if self.mode == 'train':
try:
dataset_config['transforms'][5]['MakeBorderMap'][
'epoch'] = seed if seed is not None else 0
dataset_config['transforms'][6]['MakeShrinkMap'][
'epoch'] = seed if seed is not None else 0
except Exception as E:
logger.info(E)
print(E)
return
def get_image_info_list(self, file_list, ratio_list):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册