Parcourir la source

update riverT weights

master
wangjin0928 il y a 5 mois
Parent
révision
ea689f2dc0
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. BIN
      utils/__pycache__/plots.cpython-38.pyc
  2. +2
    -2
      utils/plots.py

BIN
utils/__pycache__/plots.cpython-38.pyc Voir le fichier


+ 2
- 2
utils/plots.py Voir le fichier

@@ -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)

Chargement…
Annuler
Enregistrer