AustingDong
commited on
Commit
·
650abaa
1
Parent(s):
8f98bd6
Update model_utils.py
Browse files- demo/model_utils.py +2 -1
demo/model_utils.py
CHANGED
@@ -241,7 +241,8 @@ def add_title_to_image(image, title, font_size=50):
|
|
241 |
try:
|
242 |
font = ImageFont.truetype("arial.ttf", font_size) # Use Arial if available
|
243 |
except:
|
244 |
-
font
|
|
|
245 |
|
246 |
# Get text size (updated for PIL >= 10)
|
247 |
text_bbox = draw.textbbox((0, 0), title, font=font)
|
|
|
241 |
try:
|
242 |
font = ImageFont.truetype("arial.ttf", font_size) # Use Arial if available
|
243 |
except:
|
244 |
+
print("font arial not found")
|
245 |
+
font = ImageFont.load_default(font_size) # Use default if Arial not found
|
246 |
|
247 |
# Get text size (updated for PIL >= 10)
|
248 |
text_bbox = draw.textbbox((0, 0), title, font=font)
|