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
ModelZoo
donut_pytorch
Commits
74507ce8
Commit
74507ce8
authored
Jul 29, 2022
by
Geewook Kim
Browse files
fix: ensure RGB
parent
0e9a705a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
donut/model.py
donut/model.py
+1
-0
No files found.
donut/model.py
View file @
74507ce8
...
@@ -108,6 +108,7 @@ class SwinEncoder(nn.Module):
...
@@ -108,6 +108,7 @@ class SwinEncoder(nn.Module):
- rotate (if align_long_axis is True and image is not aligned longer axis with canvas)
- rotate (if align_long_axis is True and image is not aligned longer axis with canvas)
- pad
- pad
"""
"""
img
=
img
.
convert
(
"RGB"
)
if
self
.
align_long_axis
and
(
if
self
.
align_long_axis
and
(
(
self
.
input_size
[
0
]
>
self
.
input_size
[
1
]
and
img
.
width
>
img
.
height
)
(
self
.
input_size
[
0
]
>
self
.
input_size
[
1
]
and
img
.
width
>
img
.
height
)
or
(
self
.
input_size
[
0
]
<
self
.
input_size
[
1
]
and
img
.
width
<
img
.
height
)
or
(
self
.
input_size
[
0
]
<
self
.
input_size
[
1
]
and
img
.
width
<
img
.
height
)
...
...
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