Skip to content

Commit

Permalink
Fix possible image drawing issues (#13426)
Browse files Browse the repository at this point in the history
* Update plots.py

Fixed non-meaningful labels in the top right (row 1, column 4) plots when batch size is larger than max_subplots.

Signed-off-by: zzzer <[email protected]>

* Update plots.py

Signed-off-by: Glenn Jocher <[email protected]>

* Auto-format by https://ultralytics.com/actions

* Simple loop conditions

Simple loop conditions

Signed-off-by: zzzer <[email protected]>

---------

Signed-off-by: zzzer <[email protected]>
Signed-off-by: Glenn Jocher <[email protected]>
Co-authored-by: Glenn Jocher <[email protected]>
Co-authored-by: UltralyticsAssistant <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2024
1 parent 81ac034 commit 4c904ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def plot_images(images, targets, paths=None, fname="images.jpg", names=None):
# Annotate
fs = int((h + w) * ns * 0.01) # font size
annotator = Annotator(mosaic, line_width=round(fs / 10), font_size=fs, pil=True, example=names)
for i in range(min(bs, i + 1)):
for i in range(bs):
x, y = int(w * (i // ns)), int(h * (i % ns)) # block origin
annotator.rectangle([x, y, x + w, y + h], None, (255, 255, 255), width=2) # borders
if paths:
Expand Down

0 comments on commit 4c904ac

Please sign in to comment.