paul hilders commited on
Commit
abf0d58
1 Parent(s): 6cd59cb

Moving labels away from image border

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -91,9 +91,9 @@ def add_label_to_img(img, label, add_entity_label=True):
91
  draw = ImageDraw.Draw(img)
92
  font = ImageFont.truetype("arial.ttf", 24)
93
  if add_entity_label:
94
- draw.text((0,0), f"Entity: {str(label)}" , align="center", fill=(0, 0, 0), font=font)
95
  else:
96
- draw.text((0,0), str(label), align="center", fill=(0, 0, 0), font=font)
97
 
98
  return img
99
 
 
91
  draw = ImageDraw.Draw(img)
92
  font = ImageFont.truetype("arial.ttf", 24)
93
  if add_entity_label:
94
+ draw.text((5,5), f"Entity: {str(label)}" , align="center", fill=(0, 0, 0), font=font)
95
  else:
96
+ draw.text((5,5), str(label), align="center", fill=(0, 0, 0), font=font)
97
 
98
  return img
99