import os import gradio as gr import numpy as np from PIL import Image #Fonction du modèle provisoire def segment_image(image): overlay_image = image.copy() return overlay_image def create_interface(): with gr.Blocks() as interface: gr.HTML( """""" ) logo_path = os.path.join(os.getcwd(), 'fashionlookl1_2.png') gr.Markdown("") gr.Markdown("

FashionLook - Segment Clothes

") gr.Markdown("

" "Upload an image and let our model detect and segment clothes such as shirts, pants, skirts...""

") with gr.Row(): with gr.Column(scale=1): gr.Markdown("
Upload your image
") image_input = gr.Image(type='pil', label="Upload Image") with gr.Row(): segment_button = gr.Button("Run Segmentation", elem_id="segment-btn") with gr.Column(scale=1): gr.Markdown("
Segmented Image with Overlay
") segmented_image_output = gr.Image(type="pil", label="Segmented Image", interactive=False) # Actions liées aux inputs/outputs segment_button.click( fn=segment_image, inputs=[image_input], outputs=[segmented_image_output] ) return interface # Lancer l'interface interface = create_interface() interface.launch()