Skip to content

Commit

Permalink
fix setting of make border epoch (PaddlePaddle#13783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunting78 authored Aug 29, 2024
1 parent 759317f commit aabff39
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions ppocr/data/simple_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,10 @@ def __init__(self, config, mode, logger, seed=None):
self.data_idx_order_list = list(range(len(self.data_lines)))
if self.mode == "train" and self.do_shuffle:
self.shuffle_data_random()

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, dataset_config):
if self.mode == "train":
try:
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"][shrink_map_id]["MakeShrinkMap"][
"epoch"
] = (seed if seed is not None else 0)
except Exception as E:
print(E)
return

def get_image_info_list(self, file_list, ratio_list):
if isinstance(file_list, str):
file_list = [file_list]
Expand Down

0 comments on commit aabff39

Please sign in to comment.