Skip to content
GitLab
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
dee2c5de
Commit
dee2c5de
authored
Feb 04, 2019
by
Guillaume HEUSCH
Browse files
[test] added test for ToTensor transform on grayscale images
parent
45246db3
Pipeline
#26543
passed with stage
in 12 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/pytorch/test/test.py
View file @
dee2c5de
...
...
@@ -111,6 +111,11 @@ def test_transforms():
tt
=
ToTensor
()
tt
(
sample
)
assert
isinstance
(
sample
[
'image'
],
torch
.
Tensor
)
# grayscale
image_gray
=
numpy
.
random
.
rand
(
128
,
128
).
astype
(
"uint8"
)
sample_gray
=
{
'image'
:
image_gray
}
tt
(
sample_gray
)
assert
isinstance
(
sample
[
'image'
],
torch
.
Tensor
)
from
..datasets
import
Normalize
image_copy
=
torch
.
Tensor
(
sample
[
'image'
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment