primerz commited on
Commit
eb63384
·
verified ·
1 Parent(s): e24aa71

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +4 -1
utils.py CHANGED
@@ -7,7 +7,10 @@ import math
7
  from PIL import Image, ImageEnhance, ImageFilter, ImageDraw
8
  from config import COLOR_MATCH_CONFIG, FACE_MASK_CONFIG, AGE_BRACKETS
9
 
10
-
 
 
 
11
  def sanitize_text(text):
12
  """
13
  Remove or replace problematic characters (emojis, special unicode)
 
7
  from PIL import Image, ImageEnhance, ImageFilter, ImageDraw
8
  from config import COLOR_MATCH_CONFIG, FACE_MASK_CONFIG, AGE_BRACKETS
9
 
10
+ def safe_image_size(image):
11
+ """Get image size as pure Python ints to avoid numpy.int64 issues"""
12
+ return (ensure_int(image.width), ensure_int(image.height))
13
+
14
  def sanitize_text(text):
15
  """
16
  Remove or replace problematic characters (emojis, special unicode)