amaye15 commited on
Commit
63d8dec
1 Parent(s): f3004ad

image upload

Browse files
Files changed (1) hide show
  1. app.py +16 -4
app.py CHANGED
@@ -1,9 +1,21 @@
1
  import gradio as gr
 
2
 
3
 
4
- def greet(name):
5
- return "Hello " + name + "!!"
 
6
 
7
 
8
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
9
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from PIL import Image
3
 
4
 
5
+ # Define a function that takes an image as input and returns it
6
+ def display_image(image):
7
+ return image # Simply return the uploaded image
8
 
9
 
10
+ # Create the Gradio interface
11
+ iface = gr.Interface(
12
+ fn=display_image, # The function that handles the image
13
+ inputs="image", # Expect an image input from the user
14
+ outputs="image", # The output will also be an image
15
+ title="Image Upload and Display App",
16
+ description="Upload an image and it will be displayed below.",
17
+ layout="vertical", # Layout of the interface
18
+ )
19
+
20
+ # Launch the Gradio app
21
+ iface.launch()