"...models/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "9293be7e4dd57a9f156ebb71400ba5971acc4841"
Commit e58d3ccd authored by syiming's avatar syiming
Browse files

fix coding style

parent ca0acc9a
...@@ -411,7 +411,7 @@ def multilevel_roi_align(features, boxes, box_levels, output_size, ...@@ -411,7 +411,7 @@ def multilevel_roi_align(features, boxes, box_levels, output_size,
return features_per_box return features_per_box
def multilevel_native_crop_and_resize(images, boxes, box_levels, def multilevel_native_crop_and_resize(images, boxes, box_levels,
crop_size, scope=None): crop_size, scope=None):
"""Multilevel native crop and resize. """Multilevel native crop and resize.
...@@ -426,7 +426,7 @@ def multilevel_native_crop_and_resize(images, boxes, box_levels, ...@@ -426,7 +426,7 @@ def multilevel_native_crop_and_resize(images, boxes, box_levels,
# TODO: consider more efficient way of computing cropped features. # TODO: consider more efficient way of computing cropped features.
cropped = native_crop_and_resize(image, boxes, crop_size, scope) cropped = native_crop_and_resize(image, boxes, crop_size, scope)
cond = tf.tile(tf.equal(box_levels, level)[:, :, tf.newaxis], cond = tf.tile(tf.equal(box_levels, level)[:, :, tf.newaxis],
[1, 1] + [tf.math.reduce_prod(cropped.shape.as_list()[2:])]) [1, 1] + [tf.math.reduce_prod(cropped.shape.as_list()[2:])])
cond = tf.reshape(cond, cropped.shape) cond = tf.reshape(cond, cropped.shape)
cropped_final = tf.where(cond, cropped, tf.zeros_like(cropped)) cropped_final = tf.where(cond, cropped, tf.zeros_like(cropped))
cropped_feature_list.append(cropped_final) cropped_feature_list.append(cropped_final)
...@@ -453,15 +453,15 @@ def native_crop_and_resize(image, boxes, crop_size, scope=None): ...@@ -453,15 +453,15 @@ def native_crop_and_resize(image, boxes, crop_size, scope=None):
return tf.reshape(cropped_regions, final_shape) return tf.reshape(cropped_regions, final_shape)
def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size, def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size,
extrapolation_value=0.0, scope=None): extrapolation_value=0.0, scope=None):
"""Multilevel native crop and resize. """Multilevel native crop and resize.
Same as `matmul_crop_and_resize` but crop images according to box levels. Same as `matmul_crop_and_resize` but crop images according to box levels.
Args: Args:
images: A list of 4-D tensor of shape images: A list of 4-D tensor of shape
[batch, image_height, image_width, depth] representing features of [batch, image_height, image_width, depth] representing features of
different size. different size.
boxes: A `Tensor` of type `float32` or 'bfloat16'. boxes: A `Tensor` of type `float32` or 'bfloat16'.
A 3-D tensor of shape `[batch, num_boxes, 4]`. The boxes are specified in A 3-D tensor of shape `[batch, num_boxes, 4]`. The boxes are specified in
...@@ -481,7 +481,7 @@ def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size, ...@@ -481,7 +481,7 @@ def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size,
to be positive. to be positive.
extrapolation_value: a float value to use for extrapolation. extrapolation_value: a float value to use for extrapolation.
scope: A name for the operation (optional). scope: A name for the operation (optional).
Returns: Returns:
A 5-D tensor of shape `[batch, num_boxes, crop_height, crop_width, depth]` A 5-D tensor of shape `[batch, num_boxes, crop_height, crop_width, depth]`
""" """
......
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