def data_loader(q, ):
for start in tqdm(range(0, len(ids_test), batch_size)):
x_batch = []
end = min(start + batch_size, len(ids_test))
ids_test_batch = ids_test[start:end]
for id in ids_test_batch.values:
img = cv2.imread('input/test/{}.jpg'.format(id))
if input_size is not None:
img = cv2.resize(img, (input_size, input_size))
x_batch.append(img)
x_batch = np.array(x_batch, np.float32) / 255
q.put((ids_test_batch, x_batch))
for g in gpus:
q.put((None, None))
test_submit_multi_gpu.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录