未验证 提交 dd32d0f6 编写于 作者: S shaohua.zhang 提交者: GitHub

Update dataset_traversal.py

上级 65042ff6
...@@ -38,14 +38,14 @@ class TrainReader(object): ...@@ -38,14 +38,14 @@ class TrainReader(object):
def __call__(self, process_id): def __call__(self, process_id):
with open(self.label_file_path, "rb") as fin: with open(self.label_file_path, "rb") as fin:
label_infor_list = fin.readlines() label_infor_list = fin.readlines()
img_num = len(label_infor_list) img_num = len(label_infor_list)
img_id_list = list(range(img_num)) img_id_list = list(range(img_num))
random.shuffle(img_id_list) random.shuffle(img_id_list)
if sys.platform == "win32": if sys.platform == "win32":
print("multiprocess is not fully compatible with Windows." print("multiprocess is not fully compatible with Windows."
"num_workers will be 1.") "num_workers will be 1.")
self.num_workers = 1 self.num_workers = 1
def sample_iter_reader(): def sample_iter_reader():
for img_id in range(process_id, img_num, self.num_workers): for img_id in range(process_id, img_num, self.num_workers):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册