Skip to content
Snippets Groups Projects
Commit 52b1f3f1 authored by Olegs NIKISINS's avatar Olegs NIKISINS
Browse files

Added the unit test for negative coordinates case

parent 0fec985e
Branches
Tags
1 merge request!4This fixes the issue with negative coordinates in the face bounding box.
Pipeline #
File added
...@@ -9,6 +9,10 @@ import numpy as np ...@@ -9,6 +9,10 @@ import numpy as np
from .. import FaceDetector from .. import FaceDetector
import pkg_resources
import bob.io.base
def test_face_detector(): def test_face_detector():
""" """
Test FaceDetector class. Test FaceDetector class.
...@@ -24,4 +28,19 @@ def test_face_detector(): ...@@ -24,4 +28,19 @@ def test_face_detector():
result = FaceDetector().detect_single_face(image) result = FaceDetector().detect_single_face(image)
assert result is None assert result is None
\ No newline at end of file
# test on the actual image:
test_file = pkg_resources.resource_filename('bob.ip.dlib', 'data/test_image.hdf5')
f = bob.io.base.HDF5File(test_file) #read only
image = f.read('image') #reads integer
del f
result = FaceDetector().detect_single_face(image)
assert result[0].topleft == (0, 236)
assert result[0].bottomright == (84, 312)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment