Spaces:
Running
Running
| 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() |