Skip to content

Unit test Tester.test_draw_boxes failing on Windows/Linux/MacOS test builds #3637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mstfbl opened this issue Apr 6, 2021 · 0 comments · Fixed by #3631
Closed

Unit test Tester.test_draw_boxes failing on Windows/Linux/MacOS test builds #3637

mstfbl opened this issue Apr 6, 2021 · 0 comments · Fixed by #3631

Comments

@mstfbl
Copy link
Contributor

mstfbl commented Apr 6, 2021

🐛 Bug

Unit test Tester.test_draw_boxes is failing on all test CircleCI builds.

vision/test/test_utils.py

Lines 110 to 127 in 37eb37a

def test_draw_boxes(self):
img = torch.full((3, 100, 100), 255, dtype=torch.uint8)
img_cp = img.clone()
boxes_cp = boxes.clone()
labels = ["a", "b", "c", "d"]
colors = ["green", "#FF00FF", (0, 255, 0), "red"]
result = utils.draw_bounding_boxes(img, boxes, labels=labels, colors=colors, fill=True)
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "fakedata", "draw_boxes_util.png")
if not os.path.exists(path):
res = Image.fromarray(result.permute(1, 2, 0).contiguous().numpy())
res.save(path)
expected = torch.as_tensor(np.array(Image.open(path))).permute(2, 0, 1)
self.assertTrue(torch.equal(result, expected))
# Check if modification is not in place
self.assertTrue(torch.all(torch.eq(boxes, boxes_cp)).item())
self.assertTrue(torch.all(torch.eq(img, img_cp)).item())

To Reproduce

Steps to reproduce the behavior:

  1. Make a PR that is not changing source code
  2. View unit test CircleCI build results.

Sample builds that is not modifying existing source code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants