Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,57 +173,55 @@ def generate_funko_figurines(input_image):
|
|
| 173 |
|
| 174 |
if predicted_style_label == 'Bandholz':
|
| 175 |
process_image_Beard(background_image, 320,
|
| 176 |
-
"Data/AdobeColorFunko/Beard/Bandholz/{predicted_color_label}.png",
|
| 177 |
50, 142)
|
| 178 |
|
| 179 |
if predicted_style_label == 'ShortBeard':
|
| 180 |
process_image_Beard(background_image, 300,
|
| 181 |
-
"Data/AdobeColorFunko/Beard/ShortBeard/{predicted_color_label}.png",
|
| 182 |
62, 118)
|
| 183 |
|
| 184 |
if predicted_style_label == 'FullGoatee':
|
| 185 |
process_image_Beard(background_image, 230,
|
| 186 |
-
"Data/AdobeColorFunko/Beard/Goatee/{predicted_color_label}.png",
|
| 187 |
96, 168)
|
| 188 |
|
| 189 |
if predicted_style_label == 'RapIndustryStandards':
|
| 190 |
process_image_Beard(background_image, 290,
|
| 191 |
-
"Data/AdobeColorFunko/Beard/RapIndustry/{predicted_color_label}.png",
|
| 192 |
67, 120)
|
| 193 |
|
| 194 |
if predicted_style_label == 'Moustache':
|
| 195 |
process_image_Beard(background_image, 220,
|
| 196 |
-
"Data/AdobeColorFunko/Beard/Moustache/{predicted_color_label}.png",
|
| 197 |
100, 160)
|
| 198 |
|
| 199 |
if predicted_style_label == 'CleanShave':
|
| 200 |
process_image_Beard(background_image, 220,
|
| 201 |
-
"Data/AdobeColorFunko/Beard/CleanShave/{predicted_color_label}.png",
|
| 202 |
100, 160)
|
| 203 |
|
| 204 |
# Add other conditions for different beard styles
|
| 205 |
|
| 206 |
# Overlay hairstyle
|
| 207 |
-
if predicted_hairStyle_label == 'Afro':
|
| 208 |
-
process_image_menHair(background_image, 336, 420, 'path_to_hairstyle_image', 41, 76)
|
| 209 |
if predicted_hairStyle_label == 'Afro':
|
| 210 |
process_image_menHair(background_image, 336, 420,
|
| 211 |
-
"Data/AdobeColorFunko/MenHairstyle/Afro/{predicted_color_label}.png",
|
| 212 |
41, 76)
|
| 213 |
|
| 214 |
if predicted_hairStyle_label == 'Puff':
|
| 215 |
process_image_menHair(background_image, 320, 420,
|
| 216 |
-
"Data/AdobeColorFunko/MenHairstyle/Puff/{predicted_color_label}.png",
|
| 217 |
50, 68)
|
| 218 |
|
| 219 |
if predicted_hairStyle_label == 'Spike':
|
| 220 |
process_image_menHair(background_image, 310, 420,
|
| 221 |
-
"Data/AdobeColorFunko/MenHairstyle/Spike/{predicted_color_label}.png",
|
| 222 |
50, 70)
|
| 223 |
|
| 224 |
if predicted_hairStyle_label == 'Bald':
|
| 225 |
process_image_menHair(background_image, 310, 420,
|
| 226 |
-
"Data/AdobeColorFunko/MenHairstyle/Bald/{predicted_color_label}.png",
|
| 227 |
67, 120)
|
| 228 |
|
| 229 |
|
|
|
|
| 173 |
|
| 174 |
if predicted_style_label == 'Bandholz':
|
| 175 |
process_image_Beard(background_image, 320,
|
| 176 |
+
f"Data/AdobeColorFunko/Beard/Bandholz/{predicted_color_label}.png",
|
| 177 |
50, 142)
|
| 178 |
|
| 179 |
if predicted_style_label == 'ShortBeard':
|
| 180 |
process_image_Beard(background_image, 300,
|
| 181 |
+
f"Data/AdobeColorFunko/Beard/ShortBeard/{predicted_color_label}.png",
|
| 182 |
62, 118)
|
| 183 |
|
| 184 |
if predicted_style_label == 'FullGoatee':
|
| 185 |
process_image_Beard(background_image, 230,
|
| 186 |
+
f"Data/AdobeColorFunko/Beard/Goatee/{predicted_color_label}.png",
|
| 187 |
96, 168)
|
| 188 |
|
| 189 |
if predicted_style_label == 'RapIndustryStandards':
|
| 190 |
process_image_Beard(background_image, 290,
|
| 191 |
+
f"Data/AdobeColorFunko/Beard/RapIndustry/{predicted_color_label}.png",
|
| 192 |
67, 120)
|
| 193 |
|
| 194 |
if predicted_style_label == 'Moustache':
|
| 195 |
process_image_Beard(background_image, 220,
|
| 196 |
+
f"Data/AdobeColorFunko/Beard/Moustache/{predicted_color_label}.png",
|
| 197 |
100, 160)
|
| 198 |
|
| 199 |
if predicted_style_label == 'CleanShave':
|
| 200 |
process_image_Beard(background_image, 220,
|
| 201 |
+
f"Data/AdobeColorFunko/Beard/CleanShave/{predicted_color_label}.png",
|
| 202 |
100, 160)
|
| 203 |
|
| 204 |
# Add other conditions for different beard styles
|
| 205 |
|
| 206 |
# Overlay hairstyle
|
|
|
|
|
|
|
| 207 |
if predicted_hairStyle_label == 'Afro':
|
| 208 |
process_image_menHair(background_image, 336, 420,
|
| 209 |
+
f"Data/AdobeColorFunko/MenHairstyle/Afro/{predicted_color_label}.png",
|
| 210 |
41, 76)
|
| 211 |
|
| 212 |
if predicted_hairStyle_label == 'Puff':
|
| 213 |
process_image_menHair(background_image, 320, 420,
|
| 214 |
+
f"Data/AdobeColorFunko/MenHairstyle/Puff/{predicted_color_label}.png",
|
| 215 |
50, 68)
|
| 216 |
|
| 217 |
if predicted_hairStyle_label == 'Spike':
|
| 218 |
process_image_menHair(background_image, 310, 420,
|
| 219 |
+
f"Data/AdobeColorFunko/MenHairstyle/Spike/{predicted_color_label}.png",
|
| 220 |
50, 70)
|
| 221 |
|
| 222 |
if predicted_hairStyle_label == 'Bald':
|
| 223 |
process_image_menHair(background_image, 310, 420,
|
| 224 |
+
f"Data/AdobeColorFunko/MenHairstyle/Bald/{predicted_color_label}.png",
|
| 225 |
67, 120)
|
| 226 |
|
| 227 |
|