From 53952a46c6092e6f9c8f3bca5997515218d2ac22 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Mon, 25 May 2020 17:40:26 +0800 Subject: [PATCH] modified det reader --- ppocr/data/det/dataset_traversal.py | 5 +++++ 1 file changed, 5 insertions(+) mode change 100755 => 100644 ppocr/data/det/dataset_traversal.py diff --git a/ppocr/data/det/dataset_traversal.py b/ppocr/data/det/dataset_traversal.py old mode 100755 new mode 100644 index 3051c60d..272d7317 --- a/ppocr/data/det/dataset_traversal.py +++ b/ppocr/data/det/dataset_traversal.py @@ -13,6 +13,7 @@ #limitations under the License. import os +import sys import math import random import functools @@ -42,6 +43,10 @@ class TrainReader(object): 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 for img_id in range(process_id, img_num, self.num_workers): label_infor = label_infor_list[img_id_list[img_id]] outs = self.process(label_infor)