def attention_to_bbox(self, att):
with tf.variable_scope('attention_to_bbox'):
yx = att[..., :2] * self.inpt_size[np.newaxis, :2]
hw = att[..., 2:4] * (self.inpt_size[np.newaxis, :2] - 1)
bbox = tf.concat(axis=tf.rank(att) - 1, values=(yx, hw))
bbox.set_shape(att.get_shape()[:-1].concatenate((4,)))
return bbox
评论列表
文章目录