File size: 644 Bytes
56a9e12
f03f961
 
 
56a9e12
f03f961
 
 
3e37aa3
f03f961
 
56a9e12
f03f961
 
 
 
 
 
 
 
 
9112e74
b882389
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from PIL import Image
import os
import numpy as np

def process_image(input_image):
    # Get image size in KB
    
    return input_image

# Create Gradio interface
with gr.Blocks() as demo:
    gr.Markdown("## Image Size Checker")
    gr.Markdown("Upload an image. Output will be green if >500KB, black otherwise.")
    
    with gr.Row():
        input_image = gr.Image(type="filepath", label="Upload Image")
        output_image = gr.Image(label="Result", width=300, height=300)
    
    submit_btn = gr.Button("Check Size")
    submit_btn.click(fn=process_image, inputs=input_image, outputs=output_image)

demo.launch()