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
7fa17d78
Commit
7fa17d78
authored
Apr 10, 2023
by
Eric Mintun
Browse files
Lint.
parent
b028d543
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
segment_anything/automatic_mask_generator.py
segment_anything/automatic_mask_generator.py
+3
-3
No files found.
segment_anything/automatic_mask_generator.py
View file @
7fa17d78
...
@@ -214,7 +214,7 @@ class SamAutomaticMaskGenerator:
...
@@ -214,7 +214,7 @@ class SamAutomaticMaskGenerator:
keep_by_nms
=
batched_nms
(
keep_by_nms
=
batched_nms
(
data
[
"boxes"
].
float
(),
data
[
"boxes"
].
float
(),
scores
,
scores
,
torch
.
zeros_like
(
data
[
"boxes"
][:,
0
]),
# categories
torch
.
zeros_like
(
data
[
"boxes"
][:,
0
]),
# categories
iou_threshold
=
self
.
crop_nms_thresh
,
iou_threshold
=
self
.
crop_nms_thresh
,
)
)
data
.
filter
(
keep_by_nms
)
data
.
filter
(
keep_by_nms
)
...
@@ -251,7 +251,7 @@ class SamAutomaticMaskGenerator:
...
@@ -251,7 +251,7 @@ class SamAutomaticMaskGenerator:
keep_by_nms
=
batched_nms
(
keep_by_nms
=
batched_nms
(
data
[
"boxes"
].
float
(),
data
[
"boxes"
].
float
(),
data
[
"iou_preds"
],
data
[
"iou_preds"
],
torch
.
zeros_like
(
data
[
"boxes"
][:,
0
]),
# categories
torch
.
zeros_like
(
data
[
"boxes"
][:,
0
]),
# categories
iou_threshold
=
self
.
box_nms_thresh
,
iou_threshold
=
self
.
box_nms_thresh
,
)
)
data
.
filter
(
keep_by_nms
)
data
.
filter
(
keep_by_nms
)
...
@@ -357,7 +357,7 @@ class SamAutomaticMaskGenerator:
...
@@ -357,7 +357,7 @@ class SamAutomaticMaskGenerator:
keep_by_nms
=
batched_nms
(
keep_by_nms
=
batched_nms
(
boxes
.
float
(),
boxes
.
float
(),
torch
.
as_tensor
(
scores
),
torch
.
as_tensor
(
scores
),
torch
.
zeros_like
(
boxes
[:,
0
]),
# categories
torch
.
zeros_like
(
boxes
[:,
0
]),
# categories
iou_threshold
=
nms_thresh
,
iou_threshold
=
nms_thresh
,
)
)
...
...
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