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
评论列表
文章目录