common.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:tf-image-interpreter 作者: ThoughtWorksInc 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号