Skip to content

Commit

Permalink
修改数据增强导致的DSR报错 (#10662) (#10681)
Browse files Browse the repository at this point in the history
* 修改数据增强导致的DSR报错

* 错误修改回滚
  • Loading branch information
xu-peng-7 authored Aug 20, 2023
1 parent f9dbab8 commit b318d20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
description: Format files with ClangFormat
entry: bash .clang_format.hook -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
10 changes: 8 additions & 2 deletions ppocr/data/simple_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ def __init__(self, config, mode, logger, seed=None):
def set_epoch_as_seed(self, seed, dataset_config):
if self.mode == 'train':
try:
dataset_config['transforms'][5]['MakeBorderMap'][
border_map_id = [index
for index, dictionary in enumerate(dataset_config['transforms'])
if 'MakeBorderMap' in dictionary][0]
shrink_map_id = [index
for index, dictionary in enumerate(dataset_config['transforms'])
if 'MakeShrinkMap' in dictionary][0]
dataset_config['transforms'][border_map_id]['MakeBorderMap'][
'epoch'] = seed if seed is not None else 0
dataset_config['transforms'][6]['MakeShrinkMap'][
dataset_config['transforms'][shrink_map_id]['MakeShrinkMap'][
'epoch'] = seed if seed is not None else 0
except Exception as E:
print(E)
Expand Down

0 comments on commit b318d20

Please sign in to comment.