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
f58f1d1c
Unverified
Commit
f58f1d1c
authored
Apr 09, 2023
by
Hanzi Mao
Committed by
GitHub
Apr 09, 2023
Browse files
Merge pull request #58 from EndingCredits/main
Fix baking original input size values to ONNX graph
parents
efeab729
e9f2d580
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
segment_anything/utils/onnx.py
segment_anything/utils/onnx.py
+2
-2
No files found.
segment_anything/utils/onnx.py
View file @
f58f1d1c
...
@@ -81,8 +81,8 @@ class SamOnnxModel(nn.Module):
...
@@ -81,8 +81,8 @@ class SamOnnxModel(nn.Module):
align_corners
=
False
,
align_corners
=
False
,
)
)
prepadded_size
=
self
.
resize_longest_image_size
(
orig_im_size
,
self
.
img_size
)
prepadded_size
=
self
.
resize_longest_image_size
(
orig_im_size
,
self
.
img_size
)
.
to
(
torch
.
int64
)
masks
=
masks
[...,
:
int
(
prepadded_size
[
0
]
)
,
:
int
(
prepadded_size
[
1
]
)
]
masks
=
masks
[...,
:
prepadded_size
[
0
],
:
prepadded_size
[
1
]]
orig_im_size
=
orig_im_size
.
to
(
torch
.
int64
)
orig_im_size
=
orig_im_size
.
to
(
torch
.
int64
)
h
,
w
=
orig_im_size
[
0
],
orig_im_size
[
1
]
h
,
w
=
orig_im_size
[
0
],
orig_im_size
[
1
]
...
...
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