Ejemplo n.º 1
0
 def decoded_output_boxes_class_agnostic(self):
     """ Returns: Nx4 """
     assert self._bbox_class_agnostic
     box_logits = tf.reshape(self.box_logits, [-1, 4])
     decoded = decode_bbox_target(box_logits / self.bbox_regression_weights,
                                  self.proposals.boxes)
     return decoded
Ejemplo n.º 2
0
 def decoded_output_boxes(self):
     """ Returns: N x #class x 4 """
     anchors = tf.tile(tf.expand_dims(self.proposals.boxes, 1),
                       [1, cfg.DATA.NUM_CLASS, 1])  # N x #class x 4
     decoded_boxes = decode_bbox_target(
         self.box_logits / self.bbox_regression_weights, anchors)
     return decoded_boxes
Ejemplo n.º 3
0
 def decoded_output_boxes_for_label(self, labels):
     assert not self._bbox_class_agnostic
     indices = tf.stack(
         [tf.range(tf.size(labels, out_type=tf.int64)), labels])
     needed_logits = tf.gather_nd(self.box_logits, indices)
     decoded = decode_bbox_target(
         needed_logits / self.bbox_regression_weights, self.proposals.boxes)
     return decoded