Add compatibility for custom font sizes on bounding boxes
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
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8894
- :page_facing_up: Preview Python docs built from this PR
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 ():
NEW FAILURES - The following jobs have failed:
- Lint / python-source-and-configs / linux-job (gh)
RuntimeError: Command docker exec -t 29b7d5bc444d41e5f2172b7b1b0e4834ebb1b023664a9915a826b2fdfc93bbb3 /exec failed with exit code 1 - Tests / unittests-linux (3.10, linux.12xlarge, cpu) / linux-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-linux (3.11, linux.12xlarge, cpu) / linux-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-linux (3.12, linux.12xlarge, cpu) / linux-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-linux (3.9, linux.12xlarge, cpu) / linux-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-linux (3.9, linux.g5.4xlarge.nvidia.gpu, cuda, 11.8) / linux-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype1-cuda-sum-2-1.0] - Tests / unittests-macos (3.10, macos-m1-stable) / macos-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-macos (3.11, macos-m1-stable) / macos-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-macos (3.12, macos-m1-stable) / macos-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-macos (3.9, macos-m1-stable) / macos-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-windows (3.10, windows.4xlarge, cpu) / windows-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-windows (3.11, windows.4xlarge, cpu) / windows-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-windows (3.12, windows.4xlarge, cpu) / windows-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0] - Tests / unittests-windows (3.9, windows.4xlarge, cpu) / windows-job (gh)
test/test_ops.py::TestFocalLoss::test_jit[5-dtype0-cpu-sum-2-1.0]
BROKEN TRUNK - The following job failed but were present on the merge base:
👉 Rebase onto the `viable/strict` branch to avoid these failures
- Tests / unittests-windows (3.9, windows.g5.4xlarge.nvidia.gpu, cuda, 11.8) / windows-job (gh) (trunk failure)
AttributeError: '_OpNamespace' 'image' object has no attribute '_jpeg_version'
This comment was automatically generated by Dr. CI and updates every 15 minutes.
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: [].