Spaces:
Sleeping
Sleeping
Update run.py
Browse files
run.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def process_images(
|
4 |
-
#
|
|
|
|
|
5 |
return image1, image2
|
6 |
|
7 |
with gr.Blocks() as demo:
|
8 |
-
|
9 |
-
file_input_1 = gr.Image()
|
10 |
-
file_input_2 = gr.Image()
|
11 |
output_1 = gr.Image()
|
12 |
output_2 = gr.Image()
|
13 |
btn = gr.Button("Submit")
|
14 |
|
15 |
-
btn.click(process_images, inputs=
|
16 |
|
17 |
if __name__ == "__main__":
|
18 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def process_images(image_list):
|
4 |
+
# Assume image_list is a list containing two images
|
5 |
+
image1, image2 = image_list
|
6 |
+
# For demonstration, let's just return the two images
|
7 |
return image1, image2
|
8 |
|
9 |
with gr.Blocks() as demo:
|
10 |
+
file_input = gr.File(label="Upload two images", file_count="multiple", type="file")
|
|
|
|
|
11 |
output_1 = gr.Image()
|
12 |
output_2 = gr.Image()
|
13 |
btn = gr.Button("Submit")
|
14 |
|
15 |
+
btn.click(process_images, inputs=file_input, outputs=[output_1, output_2])
|
16 |
|
17 |
if __name__ == "__main__":
|
18 |
demo.launch()
|