(self, image, label, alpha)
| 46 | class TestBlendImages(unittest.TestCase): |
| 47 | @parameterized.expand(TESTS) |
| 48 | def test_blend(self, image, label, alpha): |
| 49 | blended = blend_images(image, label, alpha) |
| 50 | self.assertEqual(type(image), type(blended)) |
| 51 | if isinstance(blended, torch.Tensor): |
| 52 | self.assertEqual(blended.device, image.device) |
| 53 | blended = blended.cpu().numpy() |
| 54 | self.assertEqual((3,) + image[0].shape, blended.shape) |
| 55 | |
| 56 | blended = moveaxis(blended, 0, -1) # move RGB component to end |
| 57 | if blended.ndim > 3: |
| 58 | blended = blended[blended.shape[0] // 2] |
| 59 | plt.imshow(blended) |
| 60 | |
| 61 | |
| 62 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected