Unverified Commit 0bb9b914 authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Fix the spacing of labels on draw_bounding_boxes (#3895)

parent 74559c47
test/assets/fakedata/draw_boxes_util.png

547 Bytes | W: | H:

test/assets/fakedata/draw_boxes_util.png

560 Bytes | W: | H:

test/assets/fakedata/draw_boxes_util.png
test/assets/fakedata/draw_boxes_util.png
test/assets/fakedata/draw_boxes_util.png
test/assets/fakedata/draw_boxes_util.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -211,7 +211,8 @@ def draw_bounding_boxes(
draw.rectangle(bbox, width=width, outline=color)
if labels is not None:
draw.text((bbox[0], bbox[1]), labels[i], fill=color, font=txt_font)
margin = width + 1
draw.text((bbox[0] + margin, bbox[1] + margin), labels[i], fill=color, font=txt_font)
return torch.from_numpy(np.array(img_to_draw)).permute(2, 0, 1).to(dtype=torch.uint8)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment