Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
fa10f03f
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fa10f03f
编写于
1月 23, 2018
作者:
W
wanghaox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update code
上级
25a01932
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
14 deletion
+16
-14
paddle/operators/iou_similarity_op.cc
paddle/operators/iou_similarity_op.cc
+16
-12
paddle/operators/iou_similarity_op.h
paddle/operators/iou_similarity_op.h
+0
-2
未找到文件。
paddle/operators/iou_similarity_op.cc
浏览文件 @
fa10f03f
...
...
@@ -35,6 +35,7 @@ class IOUSimilarityOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ
(
y_dims
.
size
(),
2UL
,
"The rank of Input(Y) must be 2."
);
PADDLE_ENFORCE_EQ
(
y_dims
[
1
],
4UL
,
"The shape of Y is [M, 4]"
);
ctx
->
ShareLoD
(
"X"
,
/*->*/
"Out"
);
ctx
->
SetOutputDim
(
"Out"
,
framework
::
make_ddim
({
x_dims
[
0
],
y_dims
[
0
]}));
}
};
...
...
@@ -47,20 +48,23 @@ class IOUSimilarityOpMaker : public framework::OpProtoAndCheckerMaker {
"(LoDTensor, default LoDTensor<float>) "
"Box list X is a 2-D LoDTensor with shape [N, 4] holds N boxes, "
"each box is represented as [xmin, ymin, xmax, ymax], "
"the shape of X is [N, 4]. [xmin, ymin] is the lower left "
"coordinate of the box, and [xmax, ymax] is the right upper "
"coordinate of the box.This tensor can contain LoD information "
"to represent a batch of inputs. One instance of this batch can "
"contain different numbers of entities."
);
"the shape of X is [N, 4]. [xmin, ymin] is the left top "
"coordinate of the box if the input is image feature map, they "
"are close to the origin of the coordinate system. "
"[xmax, ymax] is the right bottom coordinate of the box. "
"This tensor can contain LoD information to represent a batch "
"of inputs. One instance of this batch can contain different "
"numbers of entities."
);
AddInput
(
"Y"
,
"(Tensor, default Tensor<float>) "
"Box list Y holds M boxes, each box is "
"represented as [xmin, ymin, xmax, ymax], the shape of X is [N, "
"4]. [xmin, ymin] is the lower left coordinate of the box, and "
"[xmax, ymax] is the right upper coordinate of the box."
);
"Box list Y holds M boxes, each box is represented as "
"[xmin, ymin, xmax, ymax], the shape of X is [N, 4]. "
"[xmin, ymin] is the left top coordinate of the box if the "
"input is image feature map, and [xmax, ymax] is the right "
"bottom coordinate of the box."
);
AddOutput
(
"Out"
,
"(LoDTensor
or Tensor
, the lod is same as input X) The output of "
"(LoDTensor, the lod is same as input X) The output of "
"iou_similarity op, a tensor with shape [N, M] "
"representing pairwise iou scores."
);
...
...
@@ -68,8 +72,8 @@ class IOUSimilarityOpMaker : public framework::OpProtoAndCheckerMaker {
IOU Similarity Operator.
Computes intersection-over-union (IOU) between two box lists.
Box list 'X' should be a LoDTensor and 'Y' is a common Tensor,
boxes in 'Y' are shared by all in
put images
.
Given two box A and B, the calculation of IOU is as follows:
boxes in 'Y' are shared by all in
stance of the batched inputs of X
.
Given two box
es
A and B, the calculation of IOU is as follows:
$$
IOU(A, B) =
...
...
paddle/operators/iou_similarity_op.h
浏览文件 @
fa10f03f
...
...
@@ -83,8 +83,6 @@ class IOUSimilarityKernel : public framework::OpKernel<T> {
platform
::
ForRange
<
DeviceContext
>
for_range
(
static_cast
<
const
DeviceContext
&>
(
ctx
.
device_context
()),
x_n
);
for_range
(
functor
);
out
->
set_lod
(
in_x
->
lod
());
}
};
// namespace operators
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录