rpn_data.py 文件源码

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

项目:tf-image-interpreter 作者: ThoughtWorksInc 项目源码 文件源码
def generate(self, image, scale, bboxes):
    shape = tf.shape(image)
    # TODO: NotImplementedError: Negative start indices are not currently supported
    # height, width = shape[-2:]
    # height, width = shape[-2:]
    height = shape[1]
    width = shape[2]

    if self._debug:
      height = tf.Print(height, [height], message='image height: ')
      width = tf.Print(width, [width], message='image width: ')

    anchors = self._generate_valid_anchors(width, height)
    overlaps = self._calculate_overlaps(tf.cast(anchors, dtype=tf.float32), tf.cast(bboxes, dtype=tf.float32))

    labels = self._generate_labels(overlaps)

    labels = self._subsample_positive(labels)
    labels = self._subsample_negative(labels)

    return labels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号