vis4d.op.box.encoder¶
Init box coder module.
- class DeltaXYWHBBoxDecoder(target_means=(0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0), wh_ratio_clip=0.016)[source]¶
Delta XYWH BBox decoder.
Following the practice in R-CNN, it decodes delta (dx, dy, dw, dh) back to original bbox (x1, y1, x2, y2).
Creates an instance of the class.
- Parameters:
target_means (tuple, optional) – Denormalizing means of target for delta coordinates. Defaults to (0.0, 0.0, 0.0, 0.0).
target_stds (tuple, optional) – Denormalizing standard deviation of target for delta coordinates. Defaults to (1.0, 1.0, 1.0, 1.0).
wh_ratio_clip (float, optional) – Maximum aspect ratio for boxes. Defaults to 16/1000.
- __call__(boxes, box_deltas)[source]¶
Apply box offset energies box_deltas to boxes.
- Parameters:
boxes (Tensor) – Basic boxes. Shape (B, N, 4) or (N, 4)
box_deltas (Tensor) – Encoded offsets with respect to each roi. Has shape (B, N, num_classes * 4) or (B, N, 4) or (N, num_classes * 4) or (N, 4). Note N = num_anchors * W * H when rois is a grid of anchors.Offset encoding follows [1]_.
- Returns:
Decoded boxes.
- Return type:
Tensor
- class DeltaXYWHBBoxEncoder(target_means=(0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0))[source]¶
Delta XYWH BBox encoder.
Following the practice in R-CNN, it encodes bbox (x1, y1, x2, y2) into delta (dx, dy, dw, dh).
Creates an instance of the class.
- Parameters:
target_means (tuple, optional) – Denormalizing means of target for delta coordinates. Defaults to (0.0, 0.0, 0.0, 0.0).
target_stds (tuple, optional) – Denormalizing standard deviation of target for delta coordinates. Defaults to (1.0, 1.0, 1.0, 1.0).
- __call__(boxes, targets)[source]¶
Get box regression transformation deltas.
Used to transform target boxes into target regression parameters.
- Parameters:
boxes (Tensor) – Source boxes, e.g., object proposals.
targets (Tensor) – Target of the transformation, e.g., ground-truth boxes.
- Returns:
Box transformation deltas
- Return type:
Tensor
- class QD3DTBox3DDecoder(center_scale=10.0, depth_log_scale=2.0, dim_log_scale=2.0, num_rotation_bins=2)[source]¶
3D bounding box decoder based on qd_3dt.
Creates an instance of the class.
Modules
NMS-Free bounding box coder for BEVFormer. |
|
XYWH Delta coder for 2D boxes. |
|
3D bounding box coder. |
|
YOLOX decoder for 2D boxes. |