Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -90,9 +90,9 @@ def create_label_single_pass(background_image, model_data, final_size=(520, 728)
|
|
90 |
# 3. Place your text.
|
91 |
# You may need to experiment with x/y coordinates or font sizes
|
92 |
# to make it look right in 520×728.
|
93 |
-
title_x, title_y = 32,
|
94 |
-
details_x, details_y = 480,
|
95 |
-
energy_x, energy_y = 460,
|
96 |
|
97 |
# Text 1 (title)
|
98 |
draw.text((title_x, title_y), str(model_data['model']), font=title_font, fill="black")
|
@@ -108,7 +108,7 @@ def create_label_single_pass(background_image, model_data, final_size=(520, 728)
|
|
108 |
bbox = draw.textbbox((0, 0), line, font=details_font)
|
109 |
text_width = bbox[2] - bbox[0]
|
110 |
# Right-justify the details text at details_x
|
111 |
-
draw.text((details_x - text_width, details_y + i*
|
112 |
|
113 |
# Text 3 (energy)
|
114 |
energy_text = str(model_data['energy'])
|
|
|
90 |
# 3. Place your text.
|
91 |
# You may need to experiment with x/y coordinates or font sizes
|
92 |
# to make it look right in 520×728.
|
93 |
+
title_x, title_y = 32, 145
|
94 |
+
details_x, details_y = 480, 256
|
95 |
+
energy_x, energy_y = 460, 472
|
96 |
|
97 |
# Text 1 (title)
|
98 |
draw.text((title_x, title_y), str(model_data['model']), font=title_font, fill="black")
|
|
|
108 |
bbox = draw.textbbox((0, 0), line, font=details_font)
|
109 |
text_width = bbox[2] - bbox[0]
|
110 |
# Right-justify the details text at details_x
|
111 |
+
draw.text((details_x - text_width, details_y + i*45), line, font=details_font, fill="black")
|
112 |
|
113 |
# Text 3 (energy)
|
114 |
energy_text = str(model_data['energy'])
|