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
f6956c39
Commit
f6956c39
authored
4 years ago
by
Vincent POLLET
Browse files
Options
Downloads
Plain Diff
Merge branch 'subtract_unit_test' into 'master'
Implements unit test for the subtract stream filter See merge request
!6
parents
e6b8a269
b6ff6fd6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!6
Implements unit test for the subtract stream filter
Pipeline
#42134
passed
4 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/io/stream/test/data/swir_940_dark_subtract.png
+0
-0
0 additions, 0 deletions
bob/io/stream/test/data/swir_940_dark_subtract.png
bob/io/stream/test/test.py
+13
-0
13 additions, 0 deletions
bob/io/stream/test/test.py
with
13 additions
and
0 deletions
bob/io/stream/test/data/swir_940_dark_subtract.png
0 → 100644
+
0
−
0
View file @
f6956c39
429 KiB
This diff is collapsed.
Click to expand it.
bob/io/stream/test/test.py
+
13
−
0
View file @
f6956c39
...
@@ -39,6 +39,7 @@ def test_stream():
...
@@ -39,6 +39,7 @@ def test_stream():
gt_depth
=
load
(
resource_path
(
"
test/data/reprojection_depth.png
"
))
gt_depth
=
load
(
resource_path
(
"
test/data/reprojection_depth.png
"
))
gt_warp_thermal
=
load
(
resource_path
(
"
test/data/warp_thermal.png
"
))
gt_warp_thermal
=
load
(
resource_path
(
"
test/data/warp_thermal.png
"
))
gt_warp_swir
=
load
(
resource_path
(
"
test/data/warp_swir_norm.png
"
))
gt_warp_swir
=
load
(
resource_path
(
"
test/data/warp_swir_norm.png
"
))
gt_swir_940_dark_subtract
=
load
(
resource_path
(
"
test/data/swir_940_dark_subtract.png
"
))
landmarks
=
np
.
load
(
resource_path
(
"
test/data/landmarks.npy
"
))
landmarks
=
np
.
load
(
resource_path
(
"
test/data/landmarks.npy
"
))
bounding_box
=
np
.
load
(
resource_path
(
"
test/data/bounding_box.npy
"
))
bounding_box
=
np
.
load
(
resource_path
(
"
test/data/bounding_box.npy
"
))
...
@@ -51,9 +52,14 @@ def test_stream():
...
@@ -51,9 +52,14 @@ def test_stream():
resource_path
(
"
config/idiap_face_calibration.json
"
,
"
bob.ip.stereo
"
),
resource_path
(
"
config/idiap_face_calibration.json
"
,
"
bob.ip.stereo
"
),
)
)
# stream for stereo and projection tests
color
=
f
.
stream
(
"
color
"
)
color
=
f
.
stream
(
"
color
"
)
nir_left
=
Stream
(
"
nir_left_stereo
"
).
adjust
(
color
)
nir_left
=
Stream
(
"
nir_left_stereo
"
).
adjust
(
color
)
nir_right
=
f
.
stream
(
"
nir_right_stereo
"
).
adjust
(
color
)
nir_right
=
f
.
stream
(
"
nir_right_stereo
"
).
adjust
(
color
)
# streams for subtract tests
swir_dark
=
f
.
stream
(
"
swir
"
)
swir_940
=
f
.
stream
(
"
swir_940nm
"
)
# streams for stack, normalize and warp tests
swir_1050
=
f
.
stream
(
"
swir_1050nm
"
)
swir_1050
=
f
.
stream
(
"
swir_1050nm
"
)
swir_1300
=
f
.
stream
(
"
swir_1300nm
"
)
swir_1300
=
f
.
stream
(
"
swir_1300nm
"
)
swir_1550
=
f
.
stream
(
"
swir_1550nm
"
)
swir_1550
=
f
.
stream
(
"
swir_1550nm
"
)
...
@@ -65,6 +71,10 @@ def test_stream():
...
@@ -65,6 +71,10 @@ def test_stream():
rep_color
=
color
.
reproject
(
nir_left
,
nir_right
,
map_3d
)
rep_color
=
color
.
reproject
(
nir_left
,
nir_right
,
map_3d
)
nir_left
.
set_source
(
f
)
nir_left
.
set_source
(
f
)
# subtract operations
swir_dark
=
swir_dark
.
adjust
(
color
)
swir_940
=
swir_940
.
adjust
(
color
).
subtract
(
swir_dark
)
# warp operations
# warp operations
swir_norm
=
swir_1550
.
normalize
().
stack
(
swir_1300
.
normalize
()).
stack
(
swir_1550
.
normalize
())
swir_norm
=
swir_1550
.
normalize
().
stack
(
swir_1300
.
normalize
()).
stack
(
swir_1550
.
normalize
())
warp_swir_norm
=
swir_norm
.
warp
(
color
)
warp_swir_norm
=
swir_norm
.
warp
(
color
)
...
@@ -85,6 +95,9 @@ def test_stream():
...
@@ -85,6 +95,9 @@ def test_stream():
assert
is_close_enough
(
gt_depth
,
depth
[
0
])
assert
is_close_enough
(
gt_depth
,
depth
[
0
])
assert
is_close_enough
(
gt_color
,
rep_color
[
0
])
assert
is_close_enough
(
gt_color
,
rep_color
[
0
])
# compare subtract results
assert
np
.
array_equal
(
swir_940
[
0
][
0
],
gt_swir_940_dark_subtract
)
# Compare warp results
# Compare warp results
assert
is_close_enough
(
warp_swir_norm
[
0
][
0
],
gt_warp_swir
)
assert
is_close_enough
(
warp_swir_norm
[
0
][
0
],
gt_warp_swir
)
assert
is_close_enough
(
warp_thermal
[
0
][
0
],
gt_warp_thermal
)
assert
is_close_enough
(
warp_thermal
[
0
][
0
],
gt_warp_thermal
)
...
...
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