@@ -21,9 +21,12 @@ class Test_face_recognition(unittest.TestCase):
21
21
22
22
def test_load_image_file (self ):
23
23
img = api .load_image_file (os .path .join (os .path .dirname (__file__ ), "test_images" , "obama.jpg" ))
24
-
25
24
assert img .shape == (1137 , 910 , 3 )
26
25
26
+ def test_load_image_file_32bit (self ):
27
+ img = api .load_image_file (os .path .join (os .path .dirname (__file__ ), "test_images" , "32bit.png" ))
28
+ assert img .shape == (1200 , 626 , 3 )
29
+
27
30
def test_raw_face_locations (self ):
28
31
img = api .load_image_file (os .path .join (os .path .dirname (__file__ ), "test_images" , "obama.jpg" ))
29
32
detected_faces = api ._raw_face_locations (img )
@@ -32,6 +35,14 @@ def test_raw_face_locations(self):
32
35
assert detected_faces [0 ].top () == 142
33
36
assert detected_faces [0 ].bottom () == 409
34
37
38
+ def test_raw_face_locations_32bit_image (self ):
39
+ img = api .load_image_file (os .path .join (os .path .dirname (__file__ ), "test_images" , "32bit.png" ))
40
+ detected_faces = api ._raw_face_locations (img )
41
+
42
+ assert len (detected_faces ) == 1
43
+ assert detected_faces [0 ].top () == 290
44
+ assert detected_faces [0 ].bottom () == 558
45
+
35
46
def test_face_locations (self ):
36
47
img = api .load_image_file (os .path .join (os .path .dirname (__file__ ), "test_images" , "obama.jpg" ))
37
48
detected_faces = api .face_locations (img )
0 commit comments