文档
注册

beta)torch_npu.npu_bounding_box_encode

接口原型

torch_npu.npu_bounding_box_encode(anchor_box, ground_truth_box, means0, means1, means2, means3, stds0, stds1, stds2, stds3) -> Tensor

功能描述

计算标注框和ground truth真值框之间的坐标变化。自定义FasterRcnn算子。

参数说明

  • anchor_box (Tensor) - 输入张量。锚点框。shape为(N,4)数据类型为float32的2D张量。“N”表示标注框的数量,“4”表示“x0”、“x1”、“y0”和“y1”。
  • ground_truth_box (Tensor) - 输入张量。真值框。shape为(N,4)数据类型为float32的2D张量。“N”表示标注框的数量,“4”表示“x0”、“x1”、“y0”和“y1”。
  • means0 (Float) - index。
  • means1 (Float) - index。
  • means2 (Float) - index。
  • means3 (Float, 默认值为[0,0,0,0]) - index。 "deltas" = "deltas" x "stds" + "means"
  • stds0 (Float) - index。
  • stds1 (Float) - index。
  • stds2 (Float) - index。
  • stds3 (Float, 默认值:[1.0,1.0,1.0,1.0]) -index。 "deltas" = "deltas" x "stds" + "means"

调用示例

>>> anchor_box = torch.tensor([[1., 2., 3., 4.], [3.,4., 5., 6.]], dtype = torch.float32).to("npu")
>>> ground_truth_box = torch.tensor([[5., 6., 7., 8.], [7.,8., 9., 6.]], dtype = torch.float32).to("npu")
>>> output = torch_npu.npu_bounding_box_encode(anchor_box, ground_truth_box, 0, 0, 0, 0, 0.1, 0.1, 0.2, 0.2)
>>> outputtensor([[13.3281, 13.3281,  0.0000,  0.0000],
        [13.3281,  6.6641,  0.0000, -5.4922]], device='npu:0')
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词