We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89adfff commit afaf070Copy full SHA for afaf070
1 file changed
stage5.2_first_application/pycasa/model/tests/test_image_file.py
@@ -38,3 +38,18 @@ def test_image_metadata(self):
38
expected_shape = (img.metadata['ExifImageHeight'],
39
img.metadata['ExifImageWidth'], 3)
40
self.assertEqual(data.shape, expected_shape)
41
+
42
+ def test_image_data(self):
43
+ img = ImageFile(filepath=SAMPLE_IMG1)
44
+ self.assertNotIn(0, img.data.shape)
45
+ np.testing.assert_almost_equal(img.data, img.to_array())
46
+ self.assertIsInstance(img.data, np.ndarray)
47
+ self.assertNotEqual(img.data.mean(), 0)
48
49
+ def test_face_detection(self):
50
51
+ faces = img.detect_faces()
52
+ self.assertIsInstance(faces, list)
53
+ for face in faces:
54
+ self.assertIsInstance(face, dict)
55
+ self.assertEqual(len(faces), 5)
0 commit comments