Skip to content

Commit a15a057

Browse files
committed
Add non-parallel bbox
1 parent 57f2452 commit a15a057

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
1.01 KB
Loading

test/test_utils.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
[100, 150, 150, 150, 150, 250, 100, 250],
2323
[200, 350, 250, 350, 250, 250, 200, 250],
2424
[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+
],
2536
],
2637
dtype=torch.float,
2738
)
@@ -156,12 +167,11 @@ def test_draw_boxes_with_coloured_label_backgrounds():
156167

157168

158169
@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():
160171
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"]
162173

163174
result = utils.draw_bounding_boxes(img, rotated_boxes, colors=colors)
164-
expected = torch.as_tensor(np.array(result)).permute(2, 0, 1)
165175
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "fakedata", "draw_rotated_boxes.png")
166176
expected = torch.as_tensor(np.array(Image.open(path))).permute(2, 0, 1)
167177
assert_equal(result, expected)

0 commit comments

Comments
 (0)