Skip to content
Snippets Groups Projects
Commit ddc96b55 authored by Stephane Chavin's avatar Stephane Chavin
Browse files

change YOLOv5 plot

parent 88749480
No related branches found
No related tags found
No related merge requests found
...@@ -88,8 +88,8 @@ class Annotator: ...@@ -88,8 +88,8 @@ class Annotator:
if self.pil or not is_ascii(label): if self.pil or not is_ascii(label):
self.draw.rectangle(box, width=self.lw, outline=color) # box self.draw.rectangle(box, width=self.lw, outline=color) # box
if label: if label:
w, h = self.font.getsize(label) # text width, height (WARNING: deprecated) in 9.2.0 # w, h = self.font.getsize(label) # text width, height (WARNING: deprecated) in 9.2.0
# _, _, w, h = self.font.getbbox(label) # text width, height (New) _, _, w, h = self.font.getbbox(label) # text width, height (New)
outside = box[1] - h >= 0 # label fits outside box outside = box[1] - h >= 0 # label fits outside box
self.draw.rectangle( self.draw.rectangle(
(box[0], box[1] - h if outside else box[1], box[0] + w + 1, (box[0], box[1] - h if outside else box[1], box[0] + w + 1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment