Skip to content

Commit f789651

Browse files
committed
Add test
1 parent 52d4874 commit f789651

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/test_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ def test_draw_keypoints_vanilla():
355355
assert_equal(img, img_cp)
356356

357357

358+
def test_draw_keypoins_K_equals_one():
359+
# Non-regression test for https://github.com/pytorch/vision/pull/8439
360+
img = torch.full((3, 100, 100), 0, dtype=torch.uint8)
361+
keypoints = torch.tensor([[[10, 10]]], dtype=torch.float)
362+
utils.draw_keypoints(img, keypoints)
363+
364+
358365
@pytest.mark.parametrize("colors", ["red", "#FF00FF", (1, 34, 122)])
359366
def test_draw_keypoints_colored(colors):
360367
# Keypoints is declared on top as global variable

0 commit comments

Comments
 (0)