Commit a0904210 authored by Vishnu Banna's avatar Vishnu Banna
Browse files

address comments

parent cefcb87b
...@@ -536,8 +536,8 @@ def _anchor_free_scale_boxes(encoded_boxes, ...@@ -536,8 +536,8 @@ def _anchor_free_scale_boxes(encoded_boxes,
# build a scaling tensor to get the offset of th ebox relative to the image # build a scaling tensor to get the offset of th ebox relative to the image
scaler = tf.convert_to_tensor([height, width, height, width]) scaler = tf.convert_to_tensor([height, width, height, width])
scale_down = lambda x, y: x / y scale_down = lambda x, y: x / tf.cast(y, x.dtype)
scale_up = lambda x, y: x * y scale_up = lambda x, y: x * tf.cast(y, x.dtype)
if darknet: if darknet:
scale_down = tf.grad_pass_through(scale_down) scale_down = tf.grad_pass_through(scale_down)
scale_up = tf.grad_pass_through(scale_up) scale_up = tf.grad_pass_through(scale_up)
...@@ -558,7 +558,6 @@ def _anchor_free_scale_boxes(encoded_boxes, ...@@ -558,7 +558,6 @@ def _anchor_free_scale_boxes(encoded_boxes,
pred_box = scale_down(scaled_box, (scaler * stride)) pred_box = scale_down(scaled_box, (scaler * stride))
return (scaler, scaled_box, pred_box) return (scaler, scaled_box, pred_box)
def get_predicted_box(width, def get_predicted_box(width,
height, height,
encoded_boxes, encoded_boxes,
......
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