Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
b0b30d0c
Unverified
Commit
b0b30d0c
authored
Feb 09, 2022
by
Yue Zhou
Committed by
GitHub
Feb 09, 2022
Browse files
fix bug (#1702)
parent
7df4ebed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
mmcv/ops/csrc/common/cuda/min_area_polygons_cuda.cuh
mmcv/ops/csrc/common/cuda/min_area_polygons_cuda.cuh
+4
-4
tests/test_ops/test_min_area_polygons.py
tests/test_ops/test_min_area_polygons.py
+3
-3
No files found.
mmcv/ops/csrc/common/cuda/min_area_polygons_cuda.cuh
View file @
b0b30d0c
...
...
@@ -86,8 +86,8 @@ __device__ inline void minBoundingRect(Point *ps, int n_points, float *minbox) {
float
R
[
2
][
2
];
float
rot_points
[
2
][
MAXN
];
R
[
0
][
0
]
=
cos
(
unique_angles
[
i
]);
R
[
0
][
1
]
=
-
sin
(
unique_angles
[
i
]);
R
[
1
][
0
]
=
sin
(
unique_angles
[
i
]);
R
[
0
][
1
]
=
sin
(
unique_angles
[
i
]);
R
[
1
][
0
]
=
-
sin
(
unique_angles
[
i
]);
R
[
1
][
1
]
=
cos
(
unique_angles
[
i
]);
// R x Points
for
(
int
m
=
0
;
m
<
2
;
m
++
)
{
...
...
@@ -273,8 +273,8 @@ __device__ inline void Findminbox(T const *const p, T *minpoints) {
float
R
[
2
][
2
];
R
[
0
][
0
]
=
cos
(
angle
);
R
[
0
][
1
]
=
-
sin
(
angle
);
R
[
1
][
0
]
=
sin
(
angle
);
R
[
0
][
1
]
=
sin
(
angle
);
R
[
1
][
0
]
=
-
sin
(
angle
);
R
[
1
][
1
]
=
cos
(
angle
);
minpoints
[
0
]
=
xmax
*
R
[
0
][
0
]
+
ymin
*
R
[
1
][
0
];
...
...
tests/test_ops/test_min_area_polygons.py
View file @
b0b30d0c
...
...
@@ -9,13 +9,13 @@ np_pointsets = np.asarray([[
2.0
,
1.5
,
1.5
],
[
1.
5
,
1.
5
,
2.5
,
2.5
,
1.
5
,
2.
5
,
2.
5
,
1.
5
,
1.
5
,
3.
5
,
3.
5
,
1.
5
,
2.
5
,
3.
5
,
3.
5
,
2.
5
,
2.0
,
2.0
1.
0
,
1.
0
,
8.0
,
8.0
,
1.
0
,
2.
0
,
2.
0
,
1.
0
,
1.
0
,
3.
0
,
3.
0
,
1.
0
,
2.
0
,
3.
0
,
3.
0
,
2.
0
,
1.5
,
1.5
]])
expected_polygons
=
np
.
asarray
(
[[
3.0000
,
1.0000
,
1.0000
,
1.0000
,
1.0000
,
3.0000
,
3.0000
,
3.0000
],
[
3.5000
,
1.5000
,
1.5000
,
1.5000
,
1.5000
,
3.5000
,
3.5000
,
3.5000
]])
[
8.0
,
8.0
,
2.3243
,
0.0541
,
0.0541
,
1.6757
,
5.7297
,
9.6216
]])
@
pytest
.
mark
.
skipif
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment