diff --git a/bob/bio/face/test/data/cropped.hdf5 b/bob/bio/face/test/data/cropped.hdf5 index 0a597b8160f0fdea50d8e0587cb544720ce3b33a..7ed3b698ada88cf8b1c1288466fbfc4865917f55 100644 Binary files a/bob/bio/face/test/data/cropped.hdf5 and b/bob/bio/face/test/data/cropped.hdf5 differ diff --git a/bob/bio/face/test/test_preprocessors.py b/bob/bio/face/test/test_preprocessors.py index 511fb3606a48ae70af62bb97ce905a92864a2526..766177f49acc0610d4384c02dda6b0586efc2aff 100644 --- a/bob/bio/face/test/test_preprocessors.py +++ b/bob/bio/face/test/test_preprocessors.py @@ -20,6 +20,7 @@ import numpy import pkg_resources +import pytest regenerate_refs = False @@ -55,7 +56,7 @@ def _compare( # compare reference reference = read_function(reference) - assert numpy.allclose(data, reference, atol=atol, rtol=rtol) + numpy.testing.assert_allclose(data, reference, rtol=rtol, atol=atol) return reference @@ -118,6 +119,7 @@ def test_face_crop(): cropper = bob.bio.face.preprocessor.FaceCrop( cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH), cropped_positions={"leye": LEFT_EYE_POS, "reye": RIGHT_EYE_POS}, + dtype=int, ) assert isinstance(cropper, bob.bio.face.preprocessor.FaceCrop) @@ -138,6 +140,7 @@ def test_face_crop(): "reye": annotation["reye"], "leye": annotation["leye"], }, + dtype=int, ) # result must be identical to the original face cropper (same eyes are used) @@ -226,6 +229,7 @@ def test_multi_face_crop(): eyes_cropper = bob.bio.face.preprocessor.FaceCrop( cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH), cropped_positions={"leye": LEFT_EYE_POS, "reye": RIGHT_EYE_POS}, + dtype=int, ) face_cropper = bob.bio.face.preprocessor.FaceCrop( @@ -233,6 +237,7 @@ def test_multi_face_crop(): cropper=FaceCropBoundingBox( final_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH) ), + dtype=int, ) cropper = bob.bio.face.preprocessor.MultiFaceCrop( @@ -258,18 +263,13 @@ def test_multi_face_crop(): _compare(bbox_cropped.astype("uint8"), bbox_reference) # test a ValueError is raised if the annotations don't match any cropper - try: + with pytest.raises(ValueError): annot = dict(landmark_A=(60, 60), landmark_B=(120, 120)) cropper.transform([image], [annot]) - assert ( - 0 - ), "MultiFaceCrop did not raise a ValueError for annotations matching no cropper" - except ValueError: - pass # test that the first annotator is taken when multiple exist annot = {**eye_annotation, **bbox_annotation} - eye_cropped = cropper.transform([image], [annot]) + eye_cropped = cropper.transform([image], [annot])[0] _compare(eye_cropped, eye_reference) @@ -292,7 +292,7 @@ def test_tan_triggs(): # execute face cropper _compare( - preprocessor.transform([image], [annotation]), + preprocessor.transform([image], [annotation])[0], pkg_resources.resource_filename( "bob.bio.face.test", "data/tan_triggs_cropped.hdf5" ), @@ -306,7 +306,7 @@ def test_tan_triggs(): # result must be identical to the original face cropper (same eyes are used) _compare( - preprocessor.transform([image], [annotation]), + preprocessor.transform([image], [annotation])[0], pkg_resources.resource_filename( "bob.bio.face.test", "data/tan_triggs_none.hdf5" ), @@ -333,7 +333,7 @@ def test_inorm_lbp(): # execute preprocessor _compare( - preprocessor.transform([image], [annotation]), + preprocessor.transform([image], [annotation])[0], pkg_resources.resource_filename( "bob.bio.face.test", "data/inorm_lbp_cropped.hdf5" ), @@ -366,7 +366,7 @@ def test_heq(): # execute preprocessor _compare( - preprocessor.transform([image], [annotation]), + preprocessor.transform([image], [annotation])[0], pkg_resources.resource_filename( "bob.bio.face.test", "data/histogram_cropped.hdf5" ), diff --git a/conda/meta.yaml b/conda/meta.yaml index 8b7d32801781db9861407520d09889068a7092b1..39c2d2e0cb713b993ca8525195c5103513327762 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -6,7 +6,6 @@ package: version: {{ environ.get('BOB_PACKAGE_VERSION', '0.0.1') }} build: - skip: True # [arm64] entry_points: number: {{ environ.get('BOB_BUILD_NUMBER', 0) }} run_exports: