Skip to content

Commit 55bf72d

Browse files
authored
Create image_rot90
1 parent 95a813a commit 55bf72d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

image_processing/image_rot90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
def image_rot90(images):
3+
"""
4+
One technique of data augmentation
5+
rotate all images by 90 degree
6+
"""
7+
images = tf.reshape(images, [-1, 32, 32, 3])
8+
distorted_image = tf.map_fn(lambda img: tf.image.rot90(img), images)
9+
distorted_image = tf.reshape(distorted_image, [-1, 32*32*3])
10+
return distorted_image
11+

0 commit comments

Comments
 (0)