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
Bw-bestperf
SAM
Commits
6325eb85
Commit
6325eb85
authored
Apr 06, 2023
by
Louis Maddox
Committed by
ericmintun
Apr 10, 2023
Browse files
Move batched NMS indices to correct device (closes #17)
parent
2780a301
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
segment_anything/automatic_mask_generator.py
segment_anything/automatic_mask_generator.py
+2
-2
No files found.
segment_anything/automatic_mask_generator.py
View file @
6325eb85
...
...
@@ -214,7 +214,7 @@ class SamAutomaticMaskGenerator:
keep_by_nms
=
batched_nms
(
data
[
"boxes"
].
float
(),
scores
,
torch
.
zeros
(
len
(
data
[
"boxes"
]
)
),
# categories
torch
.
zeros
_like
(
data
[
"boxes"
]
[:,
0
]
),
# categories
iou_threshold
=
self
.
crop_nms_thresh
,
)
data
.
filter
(
keep_by_nms
)
...
...
@@ -251,7 +251,7 @@ class SamAutomaticMaskGenerator:
keep_by_nms
=
batched_nms
(
data
[
"boxes"
].
float
(),
data
[
"iou_preds"
],
torch
.
zeros
(
len
(
data
[
"boxes"
]
)
),
# categories
torch
.
zeros
_like
(
data
[
"boxes"
]
[:,
0
]
),
# categories
iou_threshold
=
self
.
box_nms_thresh
,
)
data
.
filter
(
keep_by_nms
)
...
...
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