def _generate_shifts(self, width, height):
shift_x = tf.range(0, height) * self._feat_stride
shift_y = tf.range(0, width) * self._feat_stride
shift_x, shift_y = tf.meshgrid(shift_x, shift_y, indexing='ij')
shifts = tf.transpose(tf.pack(
[tf.reshape(shift_x, (-1,)),
tf.reshape(shift_y, (-1,)),
tf.reshape(shift_x, (-1,)),
tf.reshape(shift_y, (-1,))],
axis=0
))
return shifts
评论列表
文章目录