Commit e6b8a269 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Merge branch 'landmarks_bounding_box_unit_test' into 'master'

Landmarks bounding box unit test

See merge request !5
parents 4fdb411e a214aa4d
Pipeline #41842 passed with stages
in 16 minutes and 39 seconds
include README.rst buildout.cfg COPYING version.txt requirements.txt
recursive-include doc *.py *.rst *.png *.ico *.txt
recursive-include bob/io/stream *.h5 *.png *.json
recursive-include bob/io/stream *.h5 *.png *.json *.npy
......@@ -40,6 +40,11 @@ def test_stream():
gt_warp_thermal = load(resource_path("test/data/warp_thermal.png"))
gt_warp_swir = load(resource_path("test/data/warp_swir_norm.png"))
landmarks = np.load(resource_path("test/data/landmarks.npy"))
bounding_box = np.load(resource_path("test/data/bounding_box.npy"))
gt_landmarks = np.load(resource_path("test/data/projected_landmarks.npy"))
gt_bounding_box = np.load(resource_path("test/data/projected_bounding_box.npy"))
f = StreamFile(
resource_path("test/data/input_example.h5"),
resource_path("config/idiap_face_streams.json"),
......@@ -65,6 +70,10 @@ def test_stream():
warp_swir_norm = swir_norm.warp(color)
warp_thermal = thermal.normalize().warp(color)
# landmarks and bounding box
color.bounding_box[0] = bounding_box
color.image_points[0] = landmarks
# these streams have different timestamps before adjust
assert swir_1050.timestamps.shape != color.timestamps.shape
assert np.allclose(swir_1050.adjust(color).timestamps, color.timestamps)
......@@ -79,3 +88,6 @@ def test_stream():
# Compare warp results
assert is_close_enough(warp_swir_norm[0][0], gt_warp_swir)
assert is_close_enough(warp_thermal[0][0], gt_warp_thermal)
assert np.array_equal(rep_color.bounding_box[0], gt_bounding_box)
assert np.allclose(rep_color.image_points[0], gt_landmarks)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment