vision icon indicating copy to clipboard operation
vision copied to clipboard

Add compatibility for custom font sizes on bounding boxes

Open mrdbourke opened this issue 11 months ago • 2 comments

As of PIL 10.1.0+ the size parameter is available in PIL.ImageFont.load_default(size).

This enables the font_size parameter in draw_bounding_boxes to be used even if font=None.

See PIL docs: https://pillow.readthedocs.io/en/stable/reference/ImageFont.html#PIL.ImageFont.load_default

mrdbourke avatar Feb 03 '25 01:02 mrdbourke

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8894

Note: Links to docs will display an error until the docs builds have been completed.

:x: 14 New Failures, 1 Unrelated Failure

As of commit ebea484fd86d8575cb86b7aa3db65911bfc86e4b with merge base b5c7443ec28292627351dde53dcd2613fedf1cdb (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar Feb 03 '25 01:02 pytorch-bot[bot]

Thanks for the PR @mrdbourke ,

can you please look into fixing this test:

___________________________ test_draw_boxes_warning ____________________________
test/test_utils.py:211: in test_draw_boxes_warning
    with pytest.warns(UserWarning, match=re.escape("Argument 'font_size' will be ignored since 'font' is not set.")):
E   Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
E   The list of emitted warnings is: [].

NicolasHug avatar Feb 20 '25 10:02 NicolasHug