Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 676475897
  • Loading branch information
tensorflower-gardener committed Sep 19, 2024
1 parent 8a8cb09 commit 951c619
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions official/vision/utils/object_detection/visualization_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,11 @@ def _denormalize_images(images: tf.Tensor) -> tf.Tensor:
)
return tf.cast(images, dtype=tf.uint8)

if images.shape[3] > 3:
images = images[:, :, :, 0:3]
elif images.shape[3] == 1:
images = tf.image.grayscale_to_rgb(images)

images = tf.nest.map_structure(
tf.identity,
tf.map_fn(
Expand Down

0 comments on commit 951c619

Please sign in to comment.