def _generate_all_anchors(self, shifts):
num_anchors = self._anchors.shape[0]
num_shifts = tf.shape(shifts)[0]
all_anchors = (self._anchors.reshape(1, num_anchors, 4) +
tf.transpose(tf.reshape(shifts, (1, num_shifts, 4)), perm=(1, 0, 2)))
all_anchors = tf.reshape(all_anchors, (num_shifts * num_anchors, 4))
if self._debug:
num_all_anchors = num_shifts * num_anchors
tf.Print(num_all_anchors, [num_all_anchors], message='all anchor: ')
return all_anchors
评论列表
文章目录