baptistecolle HF staff commited on
Commit
40d9fb2
1 Parent(s): b7ebf4b

first version

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -222,12 +222,10 @@ def add_text(image: Image, text: str, font_size: int = 30) -> Image:
222
  """
223
  draw = ImageDraw.Draw(image)
224
 
225
- # Calculate text width and height for centering
226
- text_width, text_height = draw.textsize(text)
227
- text_x = (image.width - text_width) // 2
228
- text_y = (image.height - text_height) // 2
229
-
230
  draw.text((text_x, text_y), text, fill=(255, 0, 0))
 
231
  return image
232
 
233
  def apply_random_mask(image: Image, person: Person) -> Image:
 
222
  """
223
  draw = ImageDraw.Draw(image)
224
 
225
+ text_x = image.width // 2
226
+ text_y = image.height // 2
 
 
 
227
  draw.text((text_x, text_y), text, fill=(255, 0, 0))
228
+
229
  return image
230
 
231
  def apply_random_mask(image: Image, person: Person) -> Image: