Update app.py
Browse files97 unmodified lines989910010110210310410597 unmodified linesreturn filenamereturn ""# Define the update logic for filenamedemo.input_components[0].change(update_filename, inputs=demo.input_components[0], outputs=demo.input_components[1])if __name__ == '__main__':demo.launch()97 unmodified lines989910010110210310410510610710810911011111211311411511611711811997 unmodified linesreturn filenamereturn ""with gr.Blocks() as demo:with gr.Row():input_image = gr.Image(type='pil', label='input')filename_output = gr.Textbox(label="Image Filename", interactive=False)# Define the outputoutput_image = gr.Image(type='pil', label='output')# Define the interaction flow: when the image is uploaded, update the filenameinput_image.change(update_filename, inputs=input_image, outputs=filename_output)# Set the function to process the image with the filenameinput_image.submit(process_img, inputs=[input_image, filename_output], outputs=output_image)# Provide examplesdemo.examples = examplesif __name__ == '__main__':demo.launch()
app.py+16-2