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
dec4c129
Commit
dec4c129
authored
Apr 12, 2023
by
Eric Mintun
Browse files
Fix mypy thinking output of SamPredictor.predict is a tensor.
parent
d4ecc68d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
segment_anything/predictor.py
segment_anything/predictor.py
+4
-4
No files found.
segment_anything/predictor.py
View file @
dec4c129
...
@@ -160,10 +160,10 @@ class SamPredictor:
...
@@ -160,10 +160,10 @@ class SamPredictor:
return_logits
=
return_logits
,
return_logits
=
return_logits
,
)
)
masks
=
masks
[
0
].
detach
().
cpu
().
numpy
()
masks
_np
=
masks
[
0
].
detach
().
cpu
().
numpy
()
iou_predictions
=
iou_predictions
[
0
].
detach
().
cpu
().
numpy
()
iou_predictions
_np
=
iou_predictions
[
0
].
detach
().
cpu
().
numpy
()
low_res_masks
=
low_res_masks
[
0
].
detach
().
cpu
().
numpy
()
low_res_masks
_np
=
low_res_masks
[
0
].
detach
().
cpu
().
numpy
()
return
masks
,
iou_predictions
,
low_res_masks
return
masks
_np
,
iou_predictions
_np
,
low_res_masks
_np
@
torch
.
no_grad
()
@
torch
.
no_grad
()
def
predict_torch
(
def
predict_torch
(
...
...
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