Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bob.io.stream
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
Model registry
Operate
Environments
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
bob
bob.io.stream
Commits
14d3b0c2
Commit
14d3b0c2
authored
3 years ago
by
Vincent POLLET
Browse files
Options
Downloads
Patches
Plain Diff
Use imageio instead of opencv to load images
parent
ca94e549
No related branches found
No related tags found
1 merge request
!22
Draft: Implements metadata handling for bob.io.stream.Stream and bob.io.stream.StreamFile
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/io/stream/test/test_streams.py
+4
-7
4 additions, 7 deletions
bob/io/stream/test/test_streams.py
with
4 additions
and
7 deletions
bob/io/stream/test/test_streams.py
+
4
−
7
View file @
14d3b0c2
...
...
@@ -7,13 +7,12 @@ Test Units
# ==============================================================================
import
os
import
datetime
import
imageio
as
iio
import
numpy
as
np
import
cv2
as
cv
from
pkg_resources
import
resource_filename
from
bob.io.image
import
opencvbgr_
to_bob
from
bob.io.image
import
to_bob
from
bob.io.stream
import
StreamFile
,
Stream
from
bob.io.stream.metadata
import
MetaDatum
,
MetaData
,
MetaDataInfo
...
...
@@ -191,8 +190,8 @@ def test_stream():
def
test_filters
():
"""
Test that a few filters provide a similar result to saved groundtruth.
"""
# load groundtruth for images
gt_colormap_gray
=
opencvbgr_
to_bob
(
cv
.
imread
(
resource_path
(
"
test/data/gt_colormap_gray.png
"
)))
gt_colormap_bone
=
opencvbgr_
to_bob
(
cv
.
imread
(
resource_path
(
"
test/data/gt_colormap_bone.png
"
)))
gt_colormap_gray
=
to_bob
(
iio
.
imread
(
resource_path
(
"
test/data/gt_colormap_gray.png
"
)))
[:
3
]
# ignore alpha channel
gt_colormap_bone
=
to_bob
(
iio
.
imread
(
resource_path
(
"
test/data/gt_colormap_bone.png
"
)))
[:
3
]
gt_right_clean
=
np
.
load
(
resource_path
(
"
test/data/gt_right_clean.npy
"
))
gt_color_lightning_subtract_color_dark
=
np
.
load
(
resource_path
(
"
test/data/gt_color_lightning_subtract_color_dark.npy
"
)
...
...
@@ -218,8 +217,6 @@ def test_filters():
# adjust
left_third
=
left
[::
3
]
left_fith
=
left
[::
5
]
left_third
.
set_metadata
(
stream_metadata
,
metadata_info
)
left_fith
.
set_metadata
(
stream_metadata
,
metadata_info
)
left_fith_adjust
=
left_fith
.
adjust
(
left_third
)
assert
np
.
array_equal
(
left_third
.
metadata
(
"
timestamps
"
),
left_fith_adjust
.
metadata
(
"
timestamps
"
))
...
...
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