shaokaiye commited on
Commit
fb45f5a
β€’
1 Parent(s): e554d61

Update viz_utils.py

Browse files
Files changed (1) hide show
  1. viz_utils.py +1 -1
viz_utils.py CHANGED
@@ -104,7 +104,7 @@ def draw_bbox_w_text(img,
104
  string_bb = 'animal ' + str(round(confidence, 2))
105
  font = ImageFont.truetype(FONTS[font_style], font_size)
106
 
107
- text_size = font.getsize(string_bb) # (h,w)
108
  position = (bbxyxy[0],bbxyxy[1] - text_size[1] -2 )
109
  left, top, right, bottom = imgR.textbbox(position, string_bb, font=font)
110
  imgR.rectangle((left, top-5, right+5, bottom+5), fill="red")
 
104
  string_bb = 'animal ' + str(round(confidence, 2))
105
  font = ImageFont.truetype(FONTS[font_style], font_size)
106
 
107
+ text_size = font.getbbox(string_bb) # (h,w)
108
  position = (bbxyxy[0],bbxyxy[1] - text_size[1] -2 )
109
  left, top, right, bottom = imgR.textbbox(position, string_bb, font=font)
110
  imgR.rectangle((left, top-5, right+5, bottom+5), fill="red")