Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
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)
|