forked from mindspore-Ecosystem/mindspore
!11575 update the example of ops.BoundingBoxDecode and add nn.TimeDistributed to the import list.
From: @wangshuide2020 Reviewed-by: @liangchenghui,@wuxuejian Signed-off-by: @liangchenghui
This commit is contained in:
commit
878614e6d8
|
@ -21,8 +21,10 @@ from .cell_wrapper import TrainOneStepCell, WithLossCell, WithGradCell, WithEval
|
|||
ParameterUpdate, GetNextSingleOp, VirtualDatasetCellTriple
|
||||
from .loss_scale import TrainOneStepWithLossScaleCell, DynamicLossScaleUpdateCell, FixedLossScaleUpdateCell
|
||||
from .grad_reducer import DistributedGradReducer
|
||||
from ..layer.timedistributed import TimeDistributed
|
||||
|
||||
__all__ = [
|
||||
"TimeDistributed",
|
||||
"TrainOneStepCell",
|
||||
"WithLossCell",
|
||||
"WithGradCell",
|
||||
|
|
|
@ -128,13 +128,13 @@ class BoundingBoxEncode(PrimitiveWithInfer):
|
|||
``Ascend`` ``GPU``
|
||||
|
||||
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)
|
||||
>>> anchor_box = Tensor([[2, 2, 2, 3], [2, 2, 2, 3]], mindspore.float32)
|
||||
>>> groundtruth_box = Tensor([[1, 2, 1, 4], [1, 2, 1, 4]], mindspore.float32)
|
||||
>>> boundingbox_encode = ops.BoundingBoxEncode(means=(0.0, 0.0, 0.0, 0.0), stds=(1.0, 1.0, 1.0, 1.0))
|
||||
>>> output = boundingbox_encode(anchor_box, groundtruth_box)
|
||||
>>> print(output)
|
||||
[[ 5.0000000e-01 5.0000000e-01 -6.5504000e+04 6.9335938e-01]
|
||||
[-1.0000000e+00 2.5000000e-01 0.0000000e+00 4.0551758e-01]]
|
||||
[[ -1. 0.25 0. 0.40551758]
|
||||
[ -1. 0.25 0. 0.40551758]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
|
Loading…
Reference in New Issue