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
df505feb
Unverified
Commit
df505feb
authored
Mar 02, 2021
by
Wenhao Wu
Committed by
GitHub
Mar 02, 2021
Browse files
Fix nonzero warning (#330)
* fix nonzero warning with as_tuple * fix nonzero warning with as_tuple #320
parent
ccd3047a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
9 deletions
+12
-9
docs/index.rst
docs/index.rst
+1
-1
mmdet3d/models/dense_heads/anchor3d_head.py
mmdet3d/models/dense_heads/anchor3d_head.py
+2
-1
mmdet3d/models/dense_heads/ssd_3d_head.py
mmdet3d/models/dense_heads/ssd_3d_head.py
+2
-1
mmdet3d/models/dense_heads/train_mixins.py
mmdet3d/models/dense_heads/train_mixins.py
+4
-4
mmdet3d/models/roi_heads/bbox_heads/h3d_bbox_head.py
mmdet3d/models/roi_heads/bbox_heads/h3d_bbox_head.py
+2
-1
mmdet3d/models/roi_heads/mask_heads/primitive_head.py
mmdet3d/models/roi_heads/mask_heads/primitive_head.py
+1
-1
No files found.
docs/index.rst
View file @
df505feb
...
...
@@ -8,7 +8,7 @@ Welcome to MMDetection3D's documentation!
getting_started.md
model_zoo.md
data_preparation.md
.. toctree::
:maxdepth: 2
:caption: Quick Run
...
...
mmdet3d/models/dense_heads/anchor3d_head.py
View file @
df505feb
...
...
@@ -225,7 +225,8 @@ class Anchor3DHead(nn.Module, AnchorTrainMixin):
bg_class_ind
=
self
.
num_classes
pos_inds
=
((
labels
>=
0
)
&
(
labels
<
bg_class_ind
)).
nonzero
().
reshape
(
-
1
)
&
(
labels
<
bg_class_ind
)).
nonzero
(
as_tuple
=
False
).
reshape
(
-
1
)
num_pos
=
len
(
pos_inds
)
pos_bbox_pred
=
bbox_pred
[
pos_inds
]
...
...
mmdet3d/models/dense_heads/ssd_3d_head.py
View file @
df505feb
...
...
@@ -519,7 +519,8 @@ class SSD3DHead(VoteHead):
# filter empty boxes and boxes with low score
scores_mask
=
(
obj_scores
>=
self
.
test_cfg
.
score_thr
)
nonempty_box_inds
=
torch
.
nonzero
(
nonempty_box_mask
).
flatten
()
nonempty_box_inds
=
torch
.
nonzero
(
nonempty_box_mask
,
as_tuple
=
False
).
flatten
()
nonempty_mask
=
torch
.
zeros_like
(
bbox_classes
).
scatter
(
0
,
nonempty_box_inds
[
nms_selected
],
1
)
selected
=
(
nonempty_mask
.
bool
()
&
scores_mask
.
bool
())
...
...
mmdet3d/models/dense_heads/train_mixins.py
View file @
df505feb
...
...
@@ -277,11 +277,11 @@ class AnchorTrainMixin(object):
neg_inds
=
sampling_result
.
neg_inds
else
:
pos_inds
=
torch
.
nonzero
(
anchors
.
new_zeros
((
anchors
.
shape
[
0
],
),
dtype
=
torch
.
bool
)
>
0
).
squeeze
(
-
1
).
unique
()
anchors
.
new_zeros
((
anchors
.
shape
[
0
],
),
dtype
=
torch
.
bool
)
>
0
,
as_tuple
=
False
).
squeeze
(
-
1
).
unique
()
neg_inds
=
torch
.
nonzero
(
anchors
.
new_zeros
((
anchors
.
shape
[
0
],
),
dtype
=
torch
.
bool
)
==
0
).
squeeze
(
-
1
).
unique
()
anchors
.
new_zeros
((
anchors
.
shape
[
0
],
),
dtype
=
torch
.
bool
)
==
0
,
as_tuple
=
False
).
squeeze
(
-
1
).
unique
()
if
gt_labels
is
not
None
:
labels
+=
num_classes
...
...
mmdet3d/models/roi_heads/bbox_heads/h3d_bbox_head.py
View file @
df505feb
...
...
@@ -525,7 +525,8 @@ class H3DBboxHead(nn.Module):
# filter empty boxes and boxes with low score
scores_mask
=
(
obj_scores
>
self
.
test_cfg
.
score_thr
)
nonempty_box_inds
=
torch
.
nonzero
(
nonempty_box_mask
).
flatten
()
nonempty_box_inds
=
torch
.
nonzero
(
nonempty_box_mask
,
as_tuple
=
False
).
flatten
()
nonempty_mask
=
torch
.
zeros_like
(
bbox_classes
).
scatter
(
0
,
nonempty_box_inds
[
nms_selected
],
1
)
selected
=
(
nonempty_mask
.
bool
()
&
scores_mask
.
bool
())
...
...
mmdet3d/models/roi_heads/mask_heads/primitive_head.py
View file @
df505feb
...
...
@@ -369,7 +369,7 @@ class PrimitiveHead(nn.Module):
pts_instance_mask
[
background_mask
]
=
gt_labels_3d
.
shape
[
0
]
instance_flag
=
torch
.
nonzero
(
pts_semantic_mask
!=
self
.
num_classes
).
squeeze
(
1
)
pts_semantic_mask
!=
self
.
num_classes
,
as_tuple
=
False
).
squeeze
(
1
)
instance_labels
=
pts_instance_mask
[
instance_flag
].
unique
()
with_yaw
=
gt_bboxes_3d
.
with_yaw
...
...
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