From ec032fb018cbabf8d5442b30e14c72b517d8a8dc Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 30 Oct 2023 13:04:17 -0700 Subject: [PATCH] Use SRGBA for Mac on Python for image test PiperOrigin-RevId: 577931014 --- mediapipe/python/image_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mediapipe/python/image_test.py b/mediapipe/python/image_test.py index 79056615e..3181fb5f1 100644 --- a/mediapipe/python/image_test.py +++ b/mediapipe/python/image_test.py @@ -207,10 +207,12 @@ class ImageTest(absltest.TestCase): loaded_image = Image.create_from_file(image_path) self.assertEqual(loaded_image.width, 720) self.assertEqual(loaded_image.height, 382) - # On Mac w/ GPU support, images use 4 channels. Otherwise, all images use - # 3 channels. + # On Mac w/ GPU support, images use 4 channels (SRGBA). Otherwise, all + # images use 3 channels (SRGB). self.assertIn(loaded_image.channels, [3, 4]) - self.assertEqual(loaded_image.image_format, ImageFormat.SRGB) + self.assertIn( + loaded_image.image_format, [ImageFormat.SRGB, ImageFormat.SRGBA] + ) if __name__ == '__main__': absltest.main()