Commit 4af7e0d8 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TF Object Detection Team
Browse files

Return type change in function resize_pad_to_multiple.

Change the return type from tuple to list to keep the consistency with other preprocessing functions. The tuple return type may cause errors if we expect a list as the return type.

PiperOrigin-RevId: 328407607
parent a1a7aaca
...@@ -3111,6 +3111,7 @@ def resize_pad_to_multiple(image, masks=None, multiple=1): ...@@ -3111,6 +3111,7 @@ def resize_pad_to_multiple(image, masks=None, multiple=1):
image_height, image_width, num_channels = _get_image_info(image) image_height, image_width, num_channels = _get_image_info(image)
image = image[tf.newaxis, :, :, :] image = image[tf.newaxis, :, :, :]
image = ops.pad_to_multiple(image, multiple)[0, :, :, :] image = ops.pad_to_multiple(image, multiple)[0, :, :, :]
result = [image]
if masks is not None: if masks is not None:
masks = tf.transpose(masks, (1, 2, 0)) masks = tf.transpose(masks, (1, 2, 0))
...@@ -3118,11 +3119,10 @@ def resize_pad_to_multiple(image, masks=None, multiple=1): ...@@ -3118,11 +3119,10 @@ def resize_pad_to_multiple(image, masks=None, multiple=1):
masks = ops.pad_to_multiple(masks, multiple)[0, :, :, :] masks = ops.pad_to_multiple(masks, multiple)[0, :, :, :]
masks = tf.transpose(masks, (2, 0, 1)) masks = tf.transpose(masks, (2, 0, 1))
result.append(masks)
if masks is None: result.append(tf.stack([image_height, image_width, num_channels]))
return image, tf.stack([image_height, image_width, num_channels]) return result
else:
return image, masks, tf.stack([image_height, image_width, num_channels])
def scale_boxes_to_pixel_coordinates(image, boxes, keypoints=None): def scale_boxes_to_pixel_coordinates(image, boxes, keypoints=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment