echons commited on
Commit
a9e98de
1 Parent(s): 8a20794

Fixed object detection

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -66,8 +66,7 @@ def get_object_detection_results(detector, image_path, object_labels):
66
  score = prediction["score"]
67
  xmin, ymin, xmax, ymax = box.values()
68
  draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
69
- font = ImageFont.truetype("Arial.ttf", size=30)
70
- draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white", font=font)
71
  return image
72
 
73
  detector = initialise_object_detection_model()
 
66
  score = prediction["score"]
67
  xmin, ymin, xmax, ymax = box.values()
68
  draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
69
+ draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white")
 
70
  return image
71
 
72
  detector = initialise_object_detection_model()