반응형
def _random_flip_left_right(image_batch, label_batch, batch_size):
for i in range(batch_size):
if (np.random.rand(1) < 0.5):
sign = -1.0
tmp_image = np.fliplr(image_batch[i, :, :, :])
else:
sign = 1.0
tmp_image = image_batch[i, :, :, :]
tmp_steer = label_batch[i, 0]
image_batch[i, :, :, :] = tmp_image
label_batch[i, 0] = sign * tmp_steer
return image_batch, label_batch
'Deep Learning' 카테고리의 다른 글
[tensorflow] batch normalization code (0) | 2017.11.14 |
---|---|
[image pre-processing] image normalization (0) | 2017.11.13 |
[tensorflow] how to use the pre-trained network (0) | 2017.09.22 |
[tensorflow] how to save the filter weights of the trained network as matfile (0) | 2017.09.22 |
[TORCS] End-to-end learning for highway assistance driving system (0) | 2017.09.12 |