def _filter_inside_anchors(self, all_anchors, height, width):
# filter anchors
inds_inside = tf.where(
(all_anchors[:, 0] > 0) &
(all_anchors[:, 1] > 0) &
(all_anchors[:, 2] < width) &
(all_anchors[:, 3] < height)
)
if self._debug:
inds_inside = tf.Print(inds_inside, [tf.shape(inds_inside)], message='inside anchors: ')
anchors = tf.gather(all_anchors, inds_inside)
return anchors
评论列表
文章目录