Skip to content

Commit

Permalink
Update dataset_traversal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondYourself authored Jul 25, 2020
1 parent 65042ff commit dd32d0f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ppocr/data/det/dataset_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def __init__(self, params):

def __call__(self, process_id):
with open(self.label_file_path, "rb") as fin:
label_infor_list = fin.readlines()
img_num = len(label_infor_list)
img_id_list = list(range(img_num))
random.shuffle(img_id_list)
if sys.platform == "win32":
print("multiprocess is not fully compatible with Windows."
"num_workers will be 1.")
self.num_workers = 1
label_infor_list = fin.readlines()
img_num = len(label_infor_list)
img_id_list = list(range(img_num))
random.shuffle(img_id_list)
if sys.platform == "win32":
print("multiprocess is not fully compatible with Windows."
"num_workers will be 1.")
self.num_workers = 1

def sample_iter_reader():
for img_id in range(process_id, img_num, self.num_workers):
Expand Down

0 comments on commit dd32d0f

Please sign in to comment.