Spaces:
Sleeping
Sleeping
| 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() | |