Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改数据增强导致的DSR报错 #10662

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么修改pre-commit呢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改错了,所以又commit了一次,重新复制了一份进去

Copy link
Collaborator

@tink2123 tink2123 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git add 的时候可以去掉对这个文件的修改哈~ 没有大的影响,先合入了

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