|
|
|
@@ -76,8 +76,13 @@ class BoundingBoxEncode(PrimitiveWithInfer): |
|
|
|
Tensor, encoded bounding boxes. |
|
|
|
|
|
|
|
Examples: |
|
|
|
>>> anchor_box = Tensor([[4,1,2,1],[2,2,2,3]],mindspore.float32) |
|
|
|
>>> groundtruth_box = Tensor([[3,1,2,2],[1,2,1,4]],mindspore.float32) |
|
|
|
>>> boundingbox_encode = P.BoundingBoxEncode(means=(0.0, 0.0, 0.0, 0.0), stds=(1.0, 1.0, 1.0, 1.0)) |
|
|
|
>>> delta_box = boundingbox_encode(anchor_box, groundtruth_box) |
|
|
|
>>> boundingbox_encode(anchor_box, groundtruth_box) |
|
|
|
[[5.0000000e-01 5.0000000e-01 -6.5504000e+04 6.9335938e-01] |
|
|
|
[-1.0000000e+00 2.5000000e-01 0.0000000e+00 4.0551758e-01]] |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
@prim_attr_register |
|
|
|
@@ -118,9 +123,14 @@ class BoundingBoxDecode(PrimitiveWithInfer): |
|
|
|
Tensor, decoded boxes. |
|
|
|
|
|
|
|
Examples: |
|
|
|
>>> anchor_box = Tensor([[4,1,2,1],[2,2,2,3]],mindspore.float32) |
|
|
|
>>> deltas = Tensor([[3,1,2,2],[1,2,1,4]],mindspore.float32) |
|
|
|
>>> boundingbox_decode = P.BoundingBoxDecode(means=(0.0, 0.0, 0.0, 0.0), stds=(1.0, 1.0, 1.0, 1.0), |
|
|
|
>>> max_shape=(768, 1280), wh_ratio_clip=0.016) |
|
|
|
>>> bbox = boundingbox_decode(anchor_box, deltas) |
|
|
|
>>> boundingbox_decode(anchor_box, deltas) |
|
|
|
[[4.1953125 0. 0. 5.1953125] |
|
|
|
[2.140625 0. 3.859375 60.59375]] |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
@prim_attr_register |
|
|
|
|