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
c960273c
Unverified
Commit
c960273c
authored
Oct 14, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Oct 14, 2022
Browse files
Switch `view()` with `reshape()` on equalize (#6772)
parent
88b6b93d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
torchvision/prototype/transforms/functional/_color.py
torchvision/prototype/transforms/functional/_color.py
+1
-1
torchvision/transforms/functional_tensor.py
torchvision/transforms/functional_tensor.py
+1
-1
No files found.
torchvision/prototype/transforms/functional/_color.py
View file @
c960273c
...
...
@@ -227,7 +227,7 @@ def equalize_image_tensor(image: torch.Tensor) -> torch.Tensor:
if
image
.
numel
()
==
0
:
return
image
return
_equalize_image_tensor_vec
(
image
.
view
(
-
1
,
height
,
width
)).
view
(
image
.
shape
)
return
_equalize_image_tensor_vec
(
image
.
view
(
-
1
,
height
,
width
)).
reshape
(
image
.
shape
)
equalize_image_pil
=
_FP
.
equalize
...
...
torchvision/transforms/functional_tensor.py
View file @
c960273c
...
...
@@ -875,7 +875,7 @@ def _scale_channel(img_chan: Tensor) -> Tensor:
if
img_chan
.
is_cuda
:
hist
=
torch
.
histc
(
img_chan
.
to
(
torch
.
float32
),
bins
=
256
,
min
=
0
,
max
=
255
)
else
:
hist
=
torch
.
bincount
(
img_chan
.
view
(
-
1
),
minlength
=
256
)
hist
=
torch
.
bincount
(
img_chan
.
reshape
(
-
1
),
minlength
=
256
)
nonzero_hist
=
hist
[
hist
!=
0
]
step
=
torch
.
div
(
nonzero_hist
[:
-
1
].
sum
(),
255
,
rounding_mode
=
"floor"
)
...
...
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