Circular Smooth Label Decoder. Args: angle_preds (Tensor): The csl encoding of angle offset for each scale level. Has shape (num_anchors * H * W, coding_len) Returns: list[Tensor]: Angle offset for each scale level.
(self, angle_preds)
| 97 | return smooth_label.scatter(1, radius_range, smooth_value) |
| 98 | |
| 99 | def decode(self, angle_preds): |
| 100 | """Circular Smooth Label Decoder. |
| 101 | |
| 102 | Args: |
| 103 | angle_preds (Tensor): The csl encoding of angle offset |
| 104 | for each scale level. |
| 105 | Has shape (num_anchors * H * W, coding_len) |
| 106 | |
| 107 | Returns: |
| 108 | list[Tensor]: Angle offset for each scale level. |
| 109 | Has shape (num_anchors * H * W, 1) |
| 110 | """ |
| 111 | angle_cls_inds = torch.argmax(angle_preds, dim=1) |
| 112 | angle_pred = ((angle_cls_inds + 0.5) * |
| 113 | self.omega) % self.angle_range - self.angle_offset |
| 114 | return angle_pred * (math.pi / 180) |
no outgoing calls
no test coverage detected