Yudsky commited on
Commit
969a0fe
1 Parent(s): d9f0d78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ def predict_image(image, confidence, overlap):
38
  img = img.resize((img.width * resize_img, img.height * resize_img))
39
 
40
  draw = ImageDraw.Draw(img)
41
- font = ImageFont.load_default(size=30)
42
 
43
  for result in prediction['predictions']:
44
  x0 = result['x'] - result['width'] / 2
@@ -57,7 +57,7 @@ def predict_image(image, confidence, overlap):
57
 
58
  label = f"{result['class']} ({result['confidence']*100:.2f}%)"
59
 
60
- draw.text((x0, y0 - 35), label, fill=colors[i], font=font)
61
 
62
  if prediction['predictions'] == []:
63
  img = Image.open(image)
 
38
  img = img.resize((img.width * resize_img, img.height * resize_img))
39
 
40
  draw = ImageDraw.Draw(img)
41
+ font = ImageFont.load_default(size=20)
42
 
43
  for result in prediction['predictions']:
44
  x0 = result['x'] - result['width'] / 2
 
57
 
58
  label = f"{result['class']} ({result['confidence']*100:.2f}%)"
59
 
60
+ draw.text((x0, y0 - 25), label, fill=colors[i], font=font)
61
 
62
  if prediction['predictions'] == []:
63
  img = Image.open(image)