Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
-
from PIL import Image
|
3 |
-
import os
|
4 |
-
import numpy as np
|
5 |
|
6 |
-
def process_image(input_image):
|
7 |
-
# Get image size in KB
|
8 |
-
|
9 |
-
return input_image
|
10 |
-
|
11 |
-
# Create Gradio interface
|
12 |
with gr.Blocks() as demo:
|
13 |
-
gr.Markdown("
|
14 |
-
gr.Markdown("Upload an image. Output will be green if >500KB, black otherwise.")
|
15 |
-
|
16 |
with gr.Row():
|
17 |
-
|
18 |
-
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
with gr.Blocks() as demo:
|
4 |
+
gr.Markdown("# Image Display Demo")
|
|
|
|
|
5 |
with gr.Row():
|
6 |
+
with gr.Column():
|
7 |
+
img_input = gr.Image(type="pil", label="Upload Image")
|
8 |
+
with gr.Column():
|
9 |
+
img_output = gr.Image(label="Output Image")
|
10 |
|
11 |
+
img_input.change(
|
12 |
+
fn=lambda x: x,
|
13 |
+
inputs=img_input,
|
14 |
+
outputs=img_output
|
15 |
+
)
|
16 |
|
17 |
demo.launch()
|