Skip to content

Commit b783c27

Browse files
committed
[prepro] deprecate old functions
1 parent bc6b855 commit b783c27

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tensorlayer/prepro.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,13 @@ def distorted_images(images=None, height=24, width=24):
14231423
-----------
14241424
- `tensorflow.models.image.cifar10.cifar10_input <https://github.com/tensorflow/tensorflow/blob/r0.9/tensorflow/models/image/cifar10/cifar10_input.py>`_
14251425
"""
1426-
print(" [Warning] distorted_images will be deprecated due to speed, see TFRecord tutorial for more info...")
1426+
print("This function is deprecated, please use tf.map_fn instead, e.g:\n \
1427+
t_image = tf.map_fn(lambda img: tf.image.random_brightness(img, max_delta=32. / 255.), t_image)\n \
1428+
t_image = tf.map_fn(lambda img: tf.image.random_contrast(img, lower=0.5, upper=1.5), t_image)\n \
1429+
t_image = tf.map_fn(lambda img: tf.image.random_saturation(img, lower=0.5, upper=1.5), t_image)\n \
1430+
t_image = tf.map_fn(lambda img: tf.image.random_hue(img, max_delta=0.032), t_image)")
1431+
exit()
1432+
# print(" [Warning] distorted_images will be deprecated due to speed, see TFRecord tutorial for more info...")
14271433
try:
14281434
batch_size = int(images._shape[0])
14291435
except:
@@ -1494,7 +1500,13 @@ def crop_central_whiten_images(images=None, height=24, width=24):
14941500
----------------
14951501
- ``tensorflow.models.image.cifar10.cifar10_input``
14961502
"""
1497-
print(" [Warning] crop_central_whiten_images will be deprecated due to speed, see TFRecord tutorial for more info...")
1503+
print("This function is deprecated, please use tf.map_fn instead, e.g:\n \
1504+
t_image = tf.map_fn(lambda img: tf.image.random_brightness(img, max_delta=32. / 255.), t_image)\n \
1505+
t_image = tf.map_fn(lambda img: tf.image.random_contrast(img, lower=0.5, upper=1.5), t_image)\n \
1506+
t_image = tf.map_fn(lambda img: tf.image.random_saturation(img, lower=0.5, upper=1.5), t_image)\n \
1507+
t_image = tf.map_fn(lambda img: tf.image.random_hue(img, max_delta=0.032), t_image)")
1508+
exit()
1509+
# print(" [Warning] crop_central_whiten_images will be deprecated due to speed, see TFRecord tutorial for more info...")
14981510
try:
14991511
batch_size = int(images._shape[0])
15001512
except:

0 commit comments

Comments
 (0)