modified det reader

This commit is contained in:
tink2123 2020-05-25 17:40:26 +08:00
parent e5a2062d9e
commit 53952a46c6
1 changed files with 5 additions and 0 deletions

5
ppocr/data/det/dataset_traversal.py Executable file → Normal file
View File

@ -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)