def random_image_mirror_left_right(input_layer):
"""
Flip each image left-right like in a mirror, randomly, even at test-time.
This acts as a data augmentation technique. See:
https://stackoverflow.com/questions/39574999/tensorflow-tf-image-functions-on-an-image-batch
"""
return keras.layers.core.Lambda(function=lambda batch_imgs: tf.map_fn(
lambda img: tf.image.random_flip_left_right(img), batch_imgs
)
)(input_layer)
neural_net.py 文件源码
python
阅读 39
收藏 0
点赞 0
评论 0
评论列表
文章目录