Skip to content
Snippets Groups Projects
Commit 0359609c authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 45c9696b
Branches
No related tags found
No related merge requests found
...@@ -59,8 +59,8 @@ def augment_image_3arg(): ...@@ -59,8 +59,8 @@ def augment_image_3arg():
def rotate_fn(data, data_b, label): def rotate_fn(data, data_b, label):
times = tf.random.uniform(minval=1, maxval=4, dtype=tf.int32, shape=[]) times = tf.random.uniform(minval=1, maxval=4, dtype=tf.int32, shape=[])
return (tf.image.rot90(data, times), return (tf.image.rot90(data, times),
tf.image.rot90(data_b, times), data_b,
tf.image.rot90(label, times)) label)
data, data_b, label = tf.cond( data, data_b, label = tf.cond(
tf.less_equal(tf.random.uniform([]), 0.5), tf.less_equal(tf.random.uniform([]), 0.5),
...@@ -70,8 +70,8 @@ def augment_image_3arg(): ...@@ -70,8 +70,8 @@ def augment_image_3arg():
# Randomly flipping image (~50%) # Randomly flipping image (~50%)
def flip_fn(data, data_b, label): def flip_fn(data, data_b, label):
return (tf.image.flip_left_right(data), return (tf.image.flip_left_right(data),
tf.image.flip_left_right(data_b), data_b,
tf.image.flip_left_right(label)) label)
data, data_b, label = tf.cond( data, data_b, label = tf.cond(
tf.less_equal(tf.random.uniform([]), 0.5), tf.less_equal(tf.random.uniform([]), 0.5),
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment