(self)
| 92 | ]) |
| 93 | |
| 94 | def test_augmentors(self): |
| 95 | augmentors = self._get_augs() |
| 96 | |
| 97 | img = _rand_image() |
| 98 | orig = img.copy() |
| 99 | tfms = augmentors.get_transform(img) |
| 100 | |
| 101 | # test printing |
| 102 | print(augmentors) |
| 103 | print(tfms) |
| 104 | |
| 105 | newimg = tfms.apply_image(img) |
| 106 | print(tfms) # lazy ones will instantiate after the first apply |
| 107 | |
| 108 | newimg2 = tfms.apply_image(orig) |
| 109 | self.assertTrue(np.allclose(newimg, newimg2)) |
| 110 | self.assertEqual(newimg2.shape[0], 30) |
| 111 | |
| 112 | coords = np.asarray([[0, 0], [10, 12]], dtype="float32") |
| 113 | tfms.apply_coords(coords) |
| 114 | |
| 115 | def test_legacy_usage(self): |
| 116 | augmentors = self._get_augs() |
nothing calls this directly
no test coverage detected