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
OpenDAS
vision
Commits
51f27d76
Unverified
Commit
51f27d76
authored
Jul 28, 2022
by
vfdev
Committed by
GitHub
Jul 28, 2022
Browse files
Renamed num_bands into num_channels (#6328)
parent
77c8c91c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
torchvision/transforms/functional_pil.py
torchvision/transforms/functional_pil.py
+6
-6
No files found.
torchvision/transforms/functional_pil.py
View file @
51f27d76
...
@@ -260,15 +260,15 @@ def _parse_fill(
...
@@ -260,15 +260,15 @@ def _parse_fill(
)
->
Dict
[
str
,
Optional
[
Union
[
float
,
List
[
float
],
Tuple
[
float
,
...]]]]:
)
->
Dict
[
str
,
Optional
[
Union
[
float
,
List
[
float
],
Tuple
[
float
,
...]]]]:
# Process fill color for affine transforms
# Process fill color for affine transforms
num_
band
s
=
get_image_num_channels
(
img
)
num_
channel
s
=
get_image_num_channels
(
img
)
if
fill
is
None
:
if
fill
is
None
:
fill
=
0
fill
=
0
if
isinstance
(
fill
,
(
int
,
float
))
and
num_
band
s
>
1
:
if
isinstance
(
fill
,
(
int
,
float
))
and
num_
channel
s
>
1
:
fill
=
tuple
([
fill
]
*
num_
band
s
)
fill
=
tuple
([
fill
]
*
num_
channel
s
)
if
isinstance
(
fill
,
(
list
,
tuple
)):
if
isinstance
(
fill
,
(
list
,
tuple
)):
if
len
(
fill
)
!=
num_
band
s
:
if
len
(
fill
)
!=
num_
channel
s
:
msg
=
"The number of elements in 'fill' does not match the number of
band
s of the image ({} != {})"
msg
=
"The number of elements in 'fill' does not match the number of
channel
s of the image ({} != {})"
raise
ValueError
(
msg
.
format
(
len
(
fill
),
num_
band
s
))
raise
ValueError
(
msg
.
format
(
len
(
fill
),
num_
channel
s
))
fill
=
tuple
(
fill
)
fill
=
tuple
(
fill
)
...
...
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