Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,9 +28,7 @@ def analyze_style(image):
|
|
| 28 |
# Return predicted style string, recommendation string, and the image
|
| 29 |
return f"**Predicted Style Class:** {style_name}", rec, image
|
| 30 |
|
| 31 |
-
# Gradio Interface
|
| 32 |
title = "π StyleGuru: AI-Enhanced Fashion Designer"
|
| 33 |
-
|
| 34 |
description = """
|
| 35 |
**StyleGuru** helps fashion enthusiasts and designers analyze garment styles and get accessory & fabric recommendations. Upload a photo or sketch, and let AI do the magic!
|
| 36 |
|
|
@@ -41,21 +39,30 @@ description = """
|
|
| 41 |
"""
|
| 42 |
|
| 43 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
gr.Markdown(f"# {title}")
|
| 45 |
gr.Markdown(description)
|
| 46 |
|
| 47 |
with gr.Row():
|
| 48 |
-
image_input = gr.Image(label="Upload a garment image or sketch", type="pil"
|
| 49 |
with gr.Column():
|
| 50 |
style_output = gr.Markdown(label="Style Analysis")
|
| 51 |
rec_output = gr.Markdown(label="π Accessory & Fabric Recommendation")
|
| 52 |
|
| 53 |
analyze_button = gr.Button("Analyze Style")
|
| 54 |
-
|
| 55 |
analyze_button.click(
|
| 56 |
fn=analyze_style,
|
| 57 |
inputs=image_input,
|
| 58 |
outputs=[style_output, rec_output, image_input],
|
| 59 |
)
|
| 60 |
|
| 61 |
-
demo.launch()
|
|
|
|
| 28 |
# Return predicted style string, recommendation string, and the image
|
| 29 |
return f"**Predicted Style Class:** {style_name}", rec, image
|
| 30 |
|
|
|
|
| 31 |
title = "π StyleGuru: AI-Enhanced Fashion Designer"
|
|
|
|
| 32 |
description = """
|
| 33 |
**StyleGuru** helps fashion enthusiasts and designers analyze garment styles and get accessory & fabric recommendations. Upload a photo or sketch, and let AI do the magic!
|
| 34 |
|
|
|
|
| 39 |
"""
|
| 40 |
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
+
# CSS to hide webcam and paste buttons
|
| 43 |
+
gr.HTML("""
|
| 44 |
+
<style>
|
| 45 |
+
button[data-testid="paste-button"],
|
| 46 |
+
button[data-testid="webcam-button"] {
|
| 47 |
+
display: none !important;
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
""")
|
| 51 |
+
|
| 52 |
gr.Markdown(f"# {title}")
|
| 53 |
gr.Markdown(description)
|
| 54 |
|
| 55 |
with gr.Row():
|
| 56 |
+
image_input = gr.Image(label="Upload a garment image or sketch", type="pil")
|
| 57 |
with gr.Column():
|
| 58 |
style_output = gr.Markdown(label="Style Analysis")
|
| 59 |
rec_output = gr.Markdown(label="π Accessory & Fabric Recommendation")
|
| 60 |
|
| 61 |
analyze_button = gr.Button("Analyze Style")
|
|
|
|
| 62 |
analyze_button.click(
|
| 63 |
fn=analyze_style,
|
| 64 |
inputs=image_input,
|
| 65 |
outputs=[style_output, rec_output, image_input],
|
| 66 |
)
|
| 67 |
|
| 68 |
+
demo.launch()
|