def get_other():
start = time.time()
X = []
y = []
train_id = []
for j in range(10):
one, two = [], []
print('Load folder c{}'.format(j))
path = os.path.join('imgs2/', str(j), '*.jpg')
files = glob.glob(path)
results = Parallel(n_jobs=-1)(delayed(process_image)(im_file) for im_file in files)
one, two = zip(*results)
X.extend(one)
train_id.extend(two)
y.extend([j]*len(files))
end = time.time() - start
print("Time: %.2f seconds" % end)
return np.array(X), np.array(y), np.array(train_id)
评论列表
文章目录