def test_read_png(self): # Check across .png for img_path in get_images(IMAGE_DIR, ".png"): img_pil = torch.from_numpy(np.array(Image.open(img_path))) img_pil = img_pil.permute(2, 0, 1) img_lpng = read_png(img_path) self.assertTrue(img_lpng.equal(img_pil))
def test_read_png(self): for img_path in get_images(IMAGE_DIR, "png"): img_pil = torch.from_numpy(np.array(Image.open(img_path))) img_lpng = read_png(img_path) self.assertEqual(img_lpng, img_pil)