From 05cd1d4ffefbabe8194f7e43c59cc3d719f3f26f Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Tue, 8 Aug 2023 14:29:18 -0500 Subject: [PATCH] snapshot... --- modules/util/augment.py | 42 ----------------------------------------- 1 file changed, 42 deletions(-) diff --git a/modules/util/augment.py b/modules/util/augment.py index f88b93df..9747836f 100644 --- a/modules/util/augment.py +++ b/modules/util/augment.py @@ -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%) -- GitLab