Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
medai
software
mednet
Commits
caeabcf6
Commit
caeabcf6
authored
1 year ago
by
Daniel CARRON
Browse files
Options
Downloads
Patches
Plain Diff
[doc] More changes on transforms docstrings
parent
791e4152
No related branches found
No related tags found
1 merge request
!15
Update documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mednet/models/transforms.py
+6
-6
6 additions, 6 deletions
src/mednet/models/transforms.py
with
6 additions
and
6 deletions
src/mednet/models/transforms.py
+
6
−
6
View file @
caeabcf6
...
@@ -13,8 +13,8 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
...
@@ -13,8 +13,8 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
If the image is already in RGB format, then this is a NOOP - the same
If the image is already in RGB format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in grayscale format
tensor is returned (no cloning). If the image is in grayscale format
(number of channels = 1), then
tri
plicate
that channel 3 times (a new copy i
s
(number of
color
channels = 1), then
re
plicate
it to obtain 3 color channel
s
returned in this case).
(a new copy is
returned in this case).
Parameters
Parameters
...
@@ -28,7 +28,7 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
...
@@ -28,7 +28,7 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
-------
-------
img
img
Transformed tensor with
the channel dimension replicated 3 time
s.
Transformed tensor with
3 identical color channel
s.
"""
"""
if
img
.
ndim
<
3
:
if
img
.
ndim
<
3
:
raise
TypeError
(
raise
TypeError
(
...
@@ -56,9 +56,9 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor:
...
@@ -56,9 +56,9 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor:
"""
Converts an image in RGB to grayscale.
"""
Converts an image in RGB to grayscale.
If the image is already in grayscale format, then this is a NOOP - the same
If the image is already in grayscale format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in RGB format
, then
tensor is returned (no cloning). If the image is in RGB format
compresses the
color channels
into a single grayscale
channel
(number of
color channels
= 3), then compresses the color
channel
s into
following this equation:
a single grayscale channel
following this equation:
.. math::
.. math::
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment