Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,15 +48,6 @@ def recommend_mask(image):
|
|
| 48 |
# Initialize model and encoders
|
| 49 |
model, encoders = safe_load_model()
|
| 50 |
|
| 51 |
-
# Create Gradio interface
|
| 52 |
-
demo = gr.Interface(
|
| 53 |
-
fn=recommend_mask,
|
| 54 |
-
inputs=gr.Image(label="Upload Your Face", type="filepath"),
|
| 55 |
-
outputs=gr.Textbox(label="Recommended Mask Style"),
|
| 56 |
-
title="🎭 AI Party Mask Recommender",
|
| 57 |
-
description="Upload a photo to get a personalized mask recommendation!",
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
def initialize_fallback_model():
|
| 61 |
"""Creates and trains a simple fallback model"""
|
| 62 |
print("Initializing fallback model...")
|
|
@@ -77,5 +68,14 @@ def initialize_fallback_model():
|
|
| 77 |
|
| 78 |
return model, encoders
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
if __name__ == "__main__":
|
| 81 |
demo.launch()
|
|
|
|
| 48 |
# Initialize model and encoders
|
| 49 |
model, encoders = safe_load_model()
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
def initialize_fallback_model():
|
| 52 |
"""Creates and trains a simple fallback model"""
|
| 53 |
print("Initializing fallback model...")
|
|
|
|
| 68 |
|
| 69 |
return model, encoders
|
| 70 |
|
| 71 |
+
|
| 72 |
+
# Create Gradio interface
|
| 73 |
+
demo = gr.Interface(
|
| 74 |
+
fn=recommend_mask,
|
| 75 |
+
inputs=gr.Image(label="Upload Your Face", type="filepath"),
|
| 76 |
+
outputs=gr.Textbox(label="Recommended Mask Style"),
|
| 77 |
+
title="🎭 AI Party Mask Recommender",
|
| 78 |
+
description="Upload a photo to get a personalized mask recommendation!",
|
| 79 |
+
)
|
| 80 |
if __name__ == "__main__":
|
| 81 |
demo.launch()
|