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
1496ff0c
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0be52c07d6b9b49245b616f9738e52bcf58cd9fe"
Unverified
Commit
1496ff0c
authored
Jan 27, 2023
by
Nicolas Hug
Committed by
GitHub
Jan 27, 2023
Browse files
DataPoint.to_grayscale() -> DataPoint.rgb_to_grayscale (#7136)
parent
59dc9383
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
torchvision/prototype/datapoints/_datapoint.py
torchvision/prototype/datapoints/_datapoint.py
+1
-1
torchvision/prototype/datapoints/_image.py
torchvision/prototype/datapoints/_image.py
+1
-1
torchvision/prototype/datapoints/_video.py
torchvision/prototype/datapoints/_video.py
+1
-1
torchvision/prototype/transforms/functional/_color.py
torchvision/prototype/transforms/functional/_color.py
+1
-1
No files found.
torchvision/prototype/datapoints/_datapoint.py
View file @
1496ff0c
...
@@ -230,7 +230,7 @@ class Datapoint(torch.Tensor):
...
@@ -230,7 +230,7 @@ class Datapoint(torch.Tensor):
)
->
Datapoint
:
)
->
Datapoint
:
return
self
return
self
def
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Datapoint
:
def
rgb_
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Datapoint
:
return
self
return
self
def
adjust_brightness
(
self
,
brightness_factor
:
float
)
->
Datapoint
:
def
adjust_brightness
(
self
,
brightness_factor
:
float
)
->
Datapoint
:
...
...
torchvision/prototype/datapoints/_image.py
View file @
1496ff0c
...
@@ -169,7 +169,7 @@ class Image(Datapoint):
...
@@ -169,7 +169,7 @@ class Image(Datapoint):
)
)
return
Image
.
wrap_like
(
self
,
output
)
return
Image
.
wrap_like
(
self
,
output
)
def
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Image
:
def
rgb_
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Image
:
output
=
self
.
_F
.
rgb_to_grayscale_image_tensor
(
output
=
self
.
_F
.
rgb_to_grayscale_image_tensor
(
self
.
as_subclass
(
torch
.
Tensor
),
num_output_channels
=
num_output_channels
self
.
as_subclass
(
torch
.
Tensor
),
num_output_channels
=
num_output_channels
)
)
...
...
torchvision/prototype/datapoints/_video.py
View file @
1496ff0c
...
@@ -173,7 +173,7 @@ class Video(Datapoint):
...
@@ -173,7 +173,7 @@ class Video(Datapoint):
)
)
return
Video
.
wrap_like
(
self
,
output
)
return
Video
.
wrap_like
(
self
,
output
)
def
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Video
:
def
rgb_
to_grayscale
(
self
,
num_output_channels
:
int
=
1
)
->
Video
:
output
=
self
.
_F
.
rgb_to_grayscale_image_tensor
(
output
=
self
.
_F
.
rgb_to_grayscale_image_tensor
(
self
.
as_subclass
(
torch
.
Tensor
),
num_output_channels
=
num_output_channels
self
.
as_subclass
(
torch
.
Tensor
),
num_output_channels
=
num_output_channels
)
)
...
...
torchvision/prototype/transforms/functional/_color.py
View file @
1496ff0c
...
@@ -46,7 +46,7 @@ def rgb_to_grayscale(
...
@@ -46,7 +46,7 @@ def rgb_to_grayscale(
if
torch
.
jit
.
is_scripting
()
or
is_simple_tensor
(
inpt
):
if
torch
.
jit
.
is_scripting
()
or
is_simple_tensor
(
inpt
):
return
rgb_to_grayscale_image_tensor
(
inpt
,
num_output_channels
=
num_output_channels
)
return
rgb_to_grayscale_image_tensor
(
inpt
,
num_output_channels
=
num_output_channels
)
elif
isinstance
(
inpt
,
datapoints
.
_datapoint
.
Datapoint
):
elif
isinstance
(
inpt
,
datapoints
.
_datapoint
.
Datapoint
):
return
inpt
.
to_grayscale
(
num_output_channels
=
num_output_channels
)
return
inpt
.
rgb_
to_grayscale
(
num_output_channels
=
num_output_channels
)
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
return
rgb_to_grayscale_image_pil
(
inpt
,
num_output_channels
=
num_output_channels
)
return
rgb_to_grayscale_image_pil
(
inpt
,
num_output_channels
=
num_output_channels
)
else
:
else
:
...
...
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