Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 563749036
  • Loading branch information
grasskin authored and copybara-github committed Sep 8, 2023
1 parent f5f6f50 commit 455253b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions uncertainty_baselines/datasets/augment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import math

from keras.layers.preprocessing import image_preprocessing as image_ops
import tensorflow as tf


Expand Down Expand Up @@ -155,13 +154,13 @@ def _convert_angles_to_transform(angles, image_width, image_height):


def transform(image, transforms):
"""Prepares input data for `image_ops.transform`."""
"""Prepares input data for `image_preprocessing.transform`."""
original_ndims = tf.rank(image)
transforms = tf.convert_to_tensor(transforms, dtype=tf.float32)
if len(tf.shape(transforms)) == 1:
transforms = transforms[None]
image = to_4d(image)
image = image_ops.transform(
image = tf._keras_internal.layers.preprocessing.image_preprocessing.transform( # pylint:disable=protected-access
images=image,
transforms=transforms,
interpolation='nearest')
Expand Down

0 comments on commit 455253b

Please sign in to comment.