Spaces:
Sleeping
Sleeping
File size: 1,647 Bytes
85c5c75 05de3e0 85c5c75 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | import gradio as gr
def dummy_segmentation(image):
return image, "Aperçu de l'image segmentée"
# Définition de l'interface
titre = "Analyseur d'Inclusivité de Mode"
description = "Analysez et recommandez des styles basés sur le type de corps et l'ethnicité à l'aide de la segmentation d'image."
custom_css = """
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
color: #333;
}
.gradio-container {
max-width: 800px;
margin: auto;
padding: 2rem;
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.gr-button {
background-color: #007BFF;
color: white;
border: none;
padding: 10px 20px;
text-align: center;
font-size: 16px;
margin: 10px 0;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.gr-button:hover {
background-color: #0056b3;
}
"""
with gr.Blocks(css=custom_css) as demo:
gr.Markdown(f"# {titre}")
gr.Markdown(description)
with gr.Row():
with gr.Column():
input_image = gr.Image(label="Télécharger une image", type="pil")
analyze_button = gr.Button("Analyser")
with gr.Column():
output_image = gr.Image(label="Image segmentée")
output_text = gr.Textbox(label="Recommandations")
# Fonction fictive pour le modèle de segmentation
analyze_button.click(dummy_segmentation, inputs=input_image, outputs=[output_image, output_text])
gr.Markdown("## Résultats")
gr.Markdown("L'image segmentée et les recommandations de style apparaîtront ici.")
demo.launch()
|