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
vision
Commits
5a7010f6
"...text-generation-inference.git" did not exist on "9946165ee022bf31578e1dde3124cc61ded2b664"
Unverified
Commit
5a7010f6
authored
Jun 14, 2019
by
Francisco Massa
Committed by
GitHub
Jun 14, 2019
Browse files
Remove empty boxes before NMS (#1019)
parent
5ba95873
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
torchvision/models/detection/roi_heads.py
torchvision/models/detection/roi_heads.py
+4
-0
No files found.
torchvision/models/detection/roi_heads.py
View file @
5a7010f6
...
...
@@ -501,6 +501,10 @@ class RoIHeads(torch.nn.Module):
inds
=
torch
.
nonzero
(
scores
>
self
.
score_thresh
).
squeeze
(
1
)
boxes
,
scores
,
labels
=
boxes
[
inds
],
scores
[
inds
],
labels
[
inds
]
# remove empty boxes
keep
=
box_ops
.
remove_small_boxes
(
boxes
,
min_size
=
1e-2
)
boxes
,
scores
,
labels
=
boxes
[
keep
],
scores
[
keep
],
labels
[
keep
]
# non-maximum suppression, independently done per class
keep
=
box_ops
.
batched_nms
(
boxes
,
scores
,
labels
,
self
.
nms_thresh
)
# keep only topk scoring predictions
...
...
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