Skip to content
Snippets Groups Projects
Commit 05cd1d4f authored by tomrink's avatar tomrink
Browse files

snapshot...

parent f9f81c2d
No related branches found
No related tags found
No related merge requests found
......@@ -43,48 +43,6 @@ def augment_image(
lambda: flip_fn(data, label),
lambda: (data, label))
# Randomly setting brightness of image (~50%)
# def brightness_fn(data, label):
# delta = tf.random.uniform(minval=0, maxval=brightness_delta, dtype=tf.float32, shape=[])
# return (tf.image.adjust_brightness(data, delta=delta),
# tf.image.adjust_brightness(label, delta=delta))
#
# data, label = tf.cond(
# tf.less_equal(tf.random.uniform([]), 0.5),
# lambda: brightness_fn(data, label),
# lambda: (data, label))
#
# # Randomly setting constrast (~50%)
# def contrast_fn(data, label):
# factor = tf.random.uniform(
# minval=contrast_factor[0],
# maxval=contrast_factor[1],
# dtype=tf.float32, shape=[])
# return (tf.image.adjust_contrast(data, factor),
# tf.image.adjust_contrast(label, factor))
#
# if contrast_factor:
# data, label = tf.cond(
# tf.less_equal(tf.random.uniform([]), 0.5),
# lambda: contrast_fn(data, label),
# lambda: (data, label))
#
# # Randomly setting saturation(~50%)
# def saturation_fn(data, label):
# factor = tf.random.uniform(
# minval=saturation[0],
# maxval=saturation[1],
# dtype=tf.float32,
# shape=[])
# return (tf.image.adjust_saturation(data, factor),
# tf.image.adjust_saturation(label, factor))
#
# if saturation:
# data, label = tf.cond(
# tf.less_equal(tf.random.uniform([]), 0.5),
# lambda: saturation_fn(data, label),
# lambda: (data, label))
return data, label
# Randomly returning unchanged data (~20%)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment