Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,10 +11,16 @@ import gradio as gr
|
|
| 11 |
|
| 12 |
# Combined Code for Beard and Hairstyle Detection and Styling
|
| 13 |
|
| 14 |
-
|
| 15 |
-
"Data/AdobeColorFunko/Outfits/DummyDress1.png",
|
| 16 |
-
"Data/AdobeColorFunko/Outfits/GlassesDummy.png",
|
| 17 |
-
"Data/AdobeColorFunko/Outfits/DummyDress3.png"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
]
|
| 19 |
|
| 20 |
|
|
@@ -368,8 +374,13 @@ def generate_funko_figurines(input_image):
|
|
| 368 |
# Process background images and apply beard style and color along with hair style and color
|
| 369 |
final_images = []
|
| 370 |
|
| 371 |
-
|
| 372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
x_coordinate = 90
|
| 374 |
y_coordinate = 50
|
| 375 |
add_eyebrow(background_image, 115, 80, "Data/AdobeColorFunko/EyezBrowz/Eyebrow.png")
|
|
@@ -479,4 +490,4 @@ gr.Interface(
|
|
| 479 |
outputs=[gr.outputs.Image(type="pil", label="Generated Image " + str(i + 1)) for i in range(3)],
|
| 480 |
title="Funko Figurine Generator",
|
| 481 |
description="Generate personalized Funko figurines with different styles and backgrounds.",
|
| 482 |
-
).launch()
|
|
|
|
| 11 |
|
| 12 |
# Combined Code for Beard and Hairstyle Detection and Styling
|
| 13 |
|
| 14 |
+
male_background_image_paths = [
|
| 15 |
+
"Data/AdobeColorFunko/Outfits/MenOutfits/DummyDress1.png",
|
| 16 |
+
"Data/AdobeColorFunko/Outfits/MenOutfits/GlassesDummy.png",
|
| 17 |
+
"Data/AdobeColorFunko/Outfits/MenOutfits/DummyDress3.png"
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
female_background_image_paths = [
|
| 21 |
+
"Data/AdobeColorFunko/Outfits/WomenOutfits/WomenOne.png",
|
| 22 |
+
"Data/AdobeColorFunko/Outfits/WomenOutfits/WomenTwo.png",
|
| 23 |
+
"Data/AdobeColorFunko/Outfits/WomenOutfits/WomenThree.png"
|
| 24 |
]
|
| 25 |
|
| 26 |
|
|
|
|
| 374 |
# Process background images and apply beard style and color along with hair style and color
|
| 375 |
final_images = []
|
| 376 |
|
| 377 |
+
if predicted_gender == 'Male':
|
| 378 |
+
background_image_paths = male_background_image_paths
|
| 379 |
+
if predicted_gender == 'Female':
|
| 380 |
+
background_image_paths = female_background_image_paths
|
| 381 |
+
|
| 382 |
+
for background_image_paths in background_image_paths:
|
| 383 |
+
background_image = Image.open(background_image_paths)
|
| 384 |
x_coordinate = 90
|
| 385 |
y_coordinate = 50
|
| 386 |
add_eyebrow(background_image, 115, 80, "Data/AdobeColorFunko/EyezBrowz/Eyebrow.png")
|
|
|
|
| 490 |
outputs=[gr.outputs.Image(type="pil", label="Generated Image " + str(i + 1)) for i in range(3)],
|
| 491 |
title="Funko Figurine Generator",
|
| 492 |
description="Generate personalized Funko figurines with different styles and backgrounds.",
|
| 493 |
+
).launch()
|