Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
6d72a86b
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6d72a86b
编写于
9月 18, 2019
作者:
L
LielinJiang
提交者:
whs
9月 18, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix_roi_transform_bug (#19785)
上级
3fd3b663
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
12 deletion
+12
-12
paddle/fluid/operators/detection/roi_perspective_transform_op.cc
...fluid/operators/detection/roi_perspective_transform_op.cc
+4
-4
paddle/fluid/operators/detection/roi_perspective_transform_op.cu
...fluid/operators/detection/roi_perspective_transform_op.cu
+4
-4
python/paddle/fluid/tests/unittests/test_roi_perspective_transform_op.py
...luid/tests/unittests/test_roi_perspective_transform_op.py
+4
-4
未找到文件。
paddle/fluid/operators/detection/roi_perspective_transform_op.cc
浏览文件 @
6d72a86b
...
...
@@ -128,11 +128,11 @@ void get_transform_matrix(const int transformed_width,
T
estimated_width
=
(
len1
+
len3
)
/
2.0
;
// Get the normalized height and normalized width
int
normalized_height
=
transformed_height
;
int
normalized_height
=
std
::
max
(
2
,
transformed_height
)
;
int
normalized_width
=
std
::
round
(
estimated_width
*
(
normalized_height
-
1
)
/
estimated_height
)
+
1
;
normalized_width
=
std
::
m
in
(
normalized_width
,
transformed_width
);
normalized_width
=
std
::
m
ax
(
2
,
std
::
min
(
normalized_width
,
transformed_width
)
);
T
dx1
=
x1
-
x2
;
T
dx2
=
x3
-
x2
;
...
...
@@ -141,9 +141,9 @@ void get_transform_matrix(const int transformed_width,
T
dy2
=
y3
-
y2
;
T
dy3
=
y0
-
y1
+
y2
-
y3
;
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_width
-
1
);
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_height
-
1
);
matrix
[
8
]
=
1
;
...
...
paddle/fluid/operators/detection/roi_perspective_transform_op.cu
浏览文件 @
6d72a86b
...
...
@@ -242,10 +242,10 @@ __device__ void get_transform_matrix(const int transformed_width,
T
estimated_width
=
(
len1
+
len3
)
/
2.0
;
// Get the normalized height and normalized width
int
normalized_height
=
transformed_height
;
int
normalized_height
=
max
(
2
,
transformed_height
)
;
int
normalized_width
=
round
(
estimated_width
*
(
normalized_height
-
1
)
/
estimated_height
)
+
1
;
normalized_width
=
m
in
(
normalized_width
,
transformed_width
);
normalized_width
=
m
ax
(
2
,
min
(
normalized_width
,
transformed_width
)
);
T
dx1
=
x1
-
x2
;
T
dx2
=
x3
-
x2
;
...
...
@@ -254,9 +254,9 @@ __device__ void get_transform_matrix(const int transformed_width,
T
dy2
=
y3
-
y2
;
T
dy3
=
y0
-
y1
+
y2
-
y3
;
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_width
-
1
);
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_height
-
1
);
matrix
[
8
]
=
1
;
...
...
python/paddle/fluid/tests/unittests/test_roi_perspective_transform_op.py
浏览文件 @
6d72a86b
...
...
@@ -87,10 +87,10 @@ def get_transform_matrix(transformed_width, transformed_height, roi_x, roi_y):
estimated_height
=
(
len2
+
len4
)
/
2.0
estimated_width
=
(
len1
+
len3
)
/
2.0
normalized_height
=
transformed_height
normalized_height
=
max
(
2
,
transformed_height
)
normalized_width
=
round
(
estimated_width
*
(
normalized_height
-
1
)
/
estimated_height
)
+
1
normalized_width
=
m
in
(
normalized_width
,
transformed_width
)
normalized_width
=
m
ax
(
2
,
min
(
normalized_width
,
transformed_width
)
)
dx1
=
x1
-
x2
dx2
=
x3
-
x2
...
...
@@ -99,9 +99,9 @@ def get_transform_matrix(transformed_width, transformed_height, roi_x, roi_y):
dy2
=
y3
-
y2
dy3
=
y0
-
y1
+
y2
-
y3
matrix
=
np
.
zeros
([
9
])
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
(
matrix
[
6
]
=
(
dx3
*
dy2
-
dx2
*
dy3
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_width
-
1
)
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
)
/
(
matrix
[
7
]
=
(
dx1
*
dy3
-
dx3
*
dy1
)
/
(
dx1
*
dy2
-
dx2
*
dy1
+
1e-5
)
/
(
normalized_height
-
1
)
matrix
[
8
]
=
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录