|
import gradio as gr |
|
from PIL import Image |
|
import os |
|
import numpy as np |
|
|
|
def process_image(input_image): |
|
|
|
|
|
return input_image |
|
|
|
|
|
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() |