File size: 753 Bytes
07d1677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from PIL import Image, ImageFilter

def process_image(img):
    if img is None:
        return None
    img = img.convert("RGB")
    output = img.filter(ImageFilter.EDGE_ENHANCE_MORE)
    return output

with gr.Blocks(title="Edge Enhance Image Filter") as demo:
    gr.Markdown("## Edge Enhance Image Filter")
    gr.Markdown("Upload an image and apply EDGE_ENHANCE_MORE filter.")

    with gr.Row():
        input_image = gr.Image(type="pil", label="Upload Image")
        output_image = gr.Image(type="pil", label="Processed Image")

    process_btn = gr.Button("Process")

    process_btn.click(
        fn=process_image,
        inputs=input_image,
        outputs=output_image
    )

if __name__ == "__main__":
    demo.launch()