Browse Source

update riverT weights

master
wangjin0928 5 months ago
parent
commit
ea689f2dc0
2 changed files with 2 additions and 2 deletions
  1. BIN
      utils/__pycache__/plots.cpython-38.pyc
  2. +2
    -2
      utils/plots.py

BIN
utils/__pycache__/plots.cpython-38.pyc View File


+ 2
- 2
utils/plots.py View File

@@ -185,7 +185,7 @@ def plot_one_box(x, im, color=None, label=None, line_thickness=3):

def plot_one_box_PIL(box, im, color=None, label=None, line_thickness=None):
# Plots one bounding box on image 'im' using PIL
print('##line149:',box)
im = Image.fromarray(im)
draw = ImageDraw.Draw(im)
line_thickness = line_thickness or max(int(min(im.size) / 200), 2)
@@ -193,7 +193,7 @@ def plot_one_box_PIL(box, im, color=None, label=None, line_thickness=None):

if label:
fontsize = max(round(max(im.size) / 40), 12)
font = ImageFont.truetype("platech.ttf", fontsize,encoding='utf-8')
font = ImageFont.truetype("../AIlib2/conf/platech.ttf", fontsize,encoding='utf-8')
txt_width, txt_height = font.getsize(label)
draw.rectangle([box[0], box[1] - txt_height + 4, box[0] + txt_width, box[1]], fill=tuple(color))
draw.text((box[0], box[1] - txt_height + 1), label, fill=(255, 255, 255), font=font)

Loading…
Cancel
Save