Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.pytorch
Commits
45246db3
Commit
45246db3
authored
Feb 04, 2019
by
Guillaume HEUSCH
Browse files
modified the ToTensor transform to properly work with grasyscale images
parent
4b8da253
Pipeline
#26536
passed with stage
in 10 minutes and 6 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
bob/learn/pytorch/datasets/utils.py
View file @
45246db3
...
...
@@ -98,6 +98,8 @@ class ToTensor(object):
self
.
op
=
transforms
.
ToTensor
()
def
__call__
(
self
,
sample
):
if
len
(
sample
[
'image'
].
shape
)
==
2
:
sample
[
'image'
]
=
sample
[
'image'
][...,
numpy
.
newaxis
]
sample
[
'image'
]
=
self
.
op
(
sample
[
'image'
])
return
sample
...
...
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