|
22 | 22 | [100, 150, 150, 150, 150, 250, 100, 250],
|
23 | 23 | [200, 350, 250, 350, 250, 250, 200, 250],
|
24 | 24 | [300, 200, 200, 200, 200, 250, 300, 250],
|
| 25 | + # Not really a rectangle, but it doesn't matter |
| 26 | + [ |
| 27 | + 100, |
| 28 | + 100, |
| 29 | + 200, |
| 30 | + 50, |
| 31 | + 290, |
| 32 | + 350, |
| 33 | + 200, |
| 34 | + 400, |
| 35 | + ], |
25 | 36 | ],
|
26 | 37 | dtype=torch.float,
|
27 | 38 | )
|
@@ -156,12 +167,11 @@ def test_draw_boxes_with_coloured_label_backgrounds():
|
156 | 167 |
|
157 | 168 |
|
158 | 169 | @pytest.mark.skipif(PILLOW_VERSION < (10, 1), reason="The reference image is only valid for PIL >= 10.1")
|
159 |
| -def test_draw_rotatated_boxes(): |
| 170 | +def test_draw_rotated_boxes(): |
160 | 171 | img = torch.full((3, 500, 500), 255, dtype=torch.uint8)
|
161 |
| - colors = ["blue", "yellow", (0, 255, 0)] |
| 172 | + colors = ["blue", "yellow", (0, 255, 0), "black"] |
162 | 173 |
|
163 | 174 | result = utils.draw_bounding_boxes(img, rotated_boxes, colors=colors)
|
164 |
| - expected = torch.as_tensor(np.array(result)).permute(2, 0, 1) |
165 | 175 | path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "fakedata", "draw_rotated_boxes.png")
|
166 | 176 | expected = torch.as_tensor(np.array(Image.open(path))).permute(2, 0, 1)
|
167 | 177 | assert_equal(result, expected)
|
|
0 commit comments