def predict(self, x): """Run forward on given images and decode raw prediction into bboxes Returns: bboxes, scores, classes """ class_outputs, box_outputs = self.forward(x) anchors = box_utils.generate_anchors_boxes(x.shape[-2:])[0] return box_utils.decode(class_outputs, box_outputs, anchors)
def predict(self, x): """ Run forward on given images and decode raw prediction into bboxes Returns: torch.Tensor with bboxes, scores and classes. bboxes in `lrtb` format shape [BS, MAX_DETECTION_PER_IMAGE, 6] """ class_outputs, box_outputs = self.forward(x) anchors = box_utils.generate_anchors_boxes(x.shape[-2:])[0] return box_utils.decode(class_outputs, box_outputs, anchors)