Unverified Commit b9bd2f11 authored by srihari-humbarwadi's avatar srihari-humbarwadi
Browse files

fixed dtype bug in `resize_and_rescale_offsets`

parent cb7e2650
...@@ -35,11 +35,12 @@ def resize_and_rescale_offsets(input_tensor: tf.Tensor, target_size): ...@@ -35,11 +35,12 @@ def resize_and_rescale_offsets(input_tensor: tf.Tensor, target_size):
""" """
input_size_y = tf.shape(input_tensor)[1] input_size_y = tf.shape(input_tensor)[1]
input_size_x = tf.shape(input_tensor)[2] input_size_x = tf.shape(input_tensor)[2]
dtype = input_tensor.dtype
scale_y = tf.cast(target_size[0] - 1, tf.float32) / tf.cast( scale_y = tf.cast(target_size[0] - 1, dtype=dtype) / tf.cast(
input_size_y - 1, tf.float32) input_size_y - 1, dtype=dtype)
scale_x = tf.cast(target_size[1] - 1, tf.float32) / tf.cast( scale_x = tf.cast(target_size[1] - 1, dtype=dtype) / tf.cast(
input_size_x - 1, tf.float32) input_size_x - 1, dtype=dtype)
target_y, target_x = tf.split( target_y, target_x = tf.split(
value=input_tensor, num_or_size_splits=2, axis=3) value=input_tensor, num_or_size_splits=2, axis=3)
......
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