wildoctopus commited on
Commit
a58c851
·
verified ·
1 Parent(s): 3e37aa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -16
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("## Image Size Checker")
14
- gr.Markdown("Upload an image. Output will be green if >500KB, black otherwise.")
15
-
16
  with gr.Row():
17
- input_image = gr.Image(type="filepath", label="Upload Image")
18
- output_image = gr.Image(label="Result", width=300, height=300)
 
 
19
 
20
- submit_btn = gr.Button("Check Size")
21
- submit_btn.click(fn=process_image, inputs=input_image, outputs=output_image)
 
 
 
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()