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
mmdetection3d
Commits
8d4bef28
Unverified
Commit
8d4bef28
authored
Apr 14, 2021
by
gillbam
Committed by
GitHub
Apr 14, 2021
Browse files
[#406] - replace 'break' with 'continue' to avoid missing of points when creating voxels (#423)
parent
f482dd78
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
mmdet3d/core/voxel/voxel_generator.py
mmdet3d/core/voxel/voxel_generator.py
+2
-2
mmdet3d/ops/spconv/include/spconv/point2voxel.h
mmdet3d/ops/spconv/include/spconv/point2voxel.h
+4
-4
mmdet3d/ops/voxel/src/voxelization_cpu.cpp
mmdet3d/ops/voxel/src/voxelization_cpu.cpp
+1
-1
mmdet3d/ops/voxel/src/voxelization_cuda.cu
mmdet3d/ops/voxel/src/voxelization_cuda.cu
+1
-1
No files found.
mmdet3d/core/voxel/voxel_generator.py
View file @
8d4bef28
...
...
@@ -196,7 +196,7 @@ def _points_to_voxel_reverse_kernel(points,
if
voxelidx
==
-
1
:
voxelidx
=
voxel_num
if
voxel_num
>=
max_voxels
:
break
continue
voxel_num
+=
1
coor_to_voxelidx
[
coor
[
0
],
coor
[
1
],
coor
[
2
]]
=
voxelidx
coors
[
voxelidx
]
=
coor
...
...
@@ -268,7 +268,7 @@ def _points_to_voxel_kernel(points,
if
voxelidx
==
-
1
:
voxelidx
=
voxel_num
if
voxel_num
>=
max_voxels
:
break
continue
voxel_num
+=
1
coor_to_voxelidx
[
coor
[
0
],
coor
[
1
],
coor
[
2
]]
=
voxelidx
coors
[
voxelidx
]
=
coor
...
...
mmdet3d/ops/spconv/include/spconv/point2voxel.h
View file @
8d4bef28
...
...
@@ -70,7 +70,7 @@ int points_to_voxel_3d_np(py::array_t<DType> points, py::array_t<DType> voxels,
voxelidx
=
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
]);
if
(
voxelidx
==
-
1
)
{
voxelidx
=
voxel_num
;
if
(
voxel_num
>=
max_voxels
)
break
;
if
(
voxel_num
>=
max_voxels
)
continue
;
voxel_num
+=
1
;
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
])
=
voxelidx
;
for
(
int
k
=
0
;
k
<
NDim
;
++
k
)
{
...
...
@@ -134,7 +134,7 @@ int points_to_voxel_3d_np_mean(py::array_t<DType> points,
voxelidx
=
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
]);
if
(
voxelidx
==
-
1
)
{
voxelidx
=
voxel_num
;
if
(
voxel_num
>=
max_voxels
)
break
;
if
(
voxel_num
>=
max_voxels
)
continue
;
voxel_num
+=
1
;
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
])
=
voxelidx
;
for
(
int
k
=
0
;
k
<
NDim
;
++
k
)
{
...
...
@@ -207,7 +207,7 @@ int points_to_voxel_3d_np_height(
voxelidx
=
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
]);
if
(
voxelidx
==
-
1
)
{
voxelidx
=
voxel_num
;
if
(
voxel_num
>=
max_voxels
)
break
;
if
(
voxel_num
>=
max_voxels
)
continue
;
voxel_num
+=
1
;
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
])
=
voxelidx
;
for
(
int
k
=
0
;
k
<
NDim
;
++
k
)
{
...
...
@@ -347,7 +347,7 @@ int points_to_voxel_3d_with_filtering(
voxelidx
=
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
]);
if
(
voxelidx
==
-
1
)
{
voxelidx
=
voxel_num
;
if
(
voxel_num
>=
max_voxels
)
break
;
if
(
voxel_num
>=
max_voxels
)
continue
;
voxel_num
+=
1
;
coor_to_voxelidx_rw
(
coor
[
0
],
coor
[
1
],
coor
[
2
])
=
voxelidx
;
for
(
int
k
=
0
;
k
<
NDim
;
++
k
)
{
...
...
mmdet3d/ops/voxel/src/voxelization_cpu.cpp
View file @
8d4bef28
...
...
@@ -75,7 +75,7 @@ void hard_voxelize_kernel(const torch::TensorAccessor<T, 2> points,
// record voxel
if
(
voxelidx
==
-
1
)
{
voxelidx
=
voxel_num
;
if
(
max_voxels
!=
-
1
&&
voxel_num
>=
max_voxels
)
break
;
if
(
max_voxels
!=
-
1
&&
voxel_num
>=
max_voxels
)
continue
;
voxel_num
+=
1
;
coor_to_voxelidx
[
coor
[
i
][
0
]][
coor
[
i
][
1
]][
coor
[
i
][
2
]]
=
voxelidx
;
...
...
mmdet3d/ops/voxel/src/voxelization_cuda.cu
View file @
8d4bef28
...
...
@@ -164,7 +164,7 @@ __global__ void determin_voxel_num(
}
else
if
(
point_pos_in_voxel
==
0
)
{
// record new voxel
int
voxelidx
=
voxel_num
[
0
];
if
(
voxel_num
[
0
]
>=
max_voxels
)
break
;
if
(
voxel_num
[
0
]
>=
max_voxels
)
continue
;
voxel_num
[
0
]
+=
1
;
coor_to_voxelidx
[
i
]
=
voxelidx
;
num_points_per_voxel
[
voxelidx
]
=
1
;
...
...
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