Convert detection results to a list of numpy arrays. Args: bboxes (torch.Tensor): Bounding boxes with shape (N, 5). labels (torch.Tensor): Labels with shape (N, ). scores (torch.Tensor): Scores with shape (N, ). attrs (torch.Tensor, optional): Attributes with sha
(bboxes, scores, labels, attrs=None)
| 49 | |
| 50 | # TODO delete this |
| 51 | def bbox3d2result(bboxes, scores, labels, attrs=None): |
| 52 | """Convert detection results to a list of numpy arrays. |
| 53 | |
| 54 | Args: |
| 55 | bboxes (torch.Tensor): Bounding boxes with shape (N, 5). |
| 56 | labels (torch.Tensor): Labels with shape (N, ). |
| 57 | scores (torch.Tensor): Scores with shape (N, ). |
| 58 | attrs (torch.Tensor, optional): Attributes with shape (N, ). |
| 59 | Defaults to None. |
| 60 | |
| 61 | Returns: |
| 62 | dict[str, torch.Tensor]: Bounding box results in cpu mode. |
| 63 | |
| 64 | - boxes_3d (torch.Tensor): 3D boxes. |
| 65 | - scores (torch.Tensor): Prediction scores. |
| 66 | - labels_3d (torch.Tensor): Box labels. |
| 67 | - attrs_3d (torch.Tensor, optional): Box attributes. |
| 68 | """ |
| 69 | result_dict = dict(bboxes_3d=bboxes.to('cpu'), |
| 70 | scores_3d=scores.cpu(), |
| 71 | labels_3d=labels.cpu()) |
| 72 | |
| 73 | if attrs is not None: |
| 74 | result_dict['attr_labels'] = attrs.cpu() |
| 75 | |
| 76 | return result_dict |