Created App with Gaussian Blur Features
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def process_image(image):
|
4 |
+
# Perform segmentation and apply Gaussian blur (steps above)
|
5 |
+
# Return output images for display
|
6 |
+
|
7 |
+
segmented_output = ... # Segmented output with blurred background
|
8 |
+
depth_map_output = ... # Depth map visualization
|
9 |
+
variable_blur_output = ... # Variable Gaussian blur
|
10 |
+
|
11 |
+
return segmented_output, depth_map_output, variable_blur_output
|
12 |
+
|
13 |
+
app = gr.Interface(
|
14 |
+
fn=process_image,
|
15 |
+
inputs=gr.Image(type="pil"),
|
16 |
+
outputs=[gr.Image(type="pil"), gr.Image(type="pil"), gr.Image(type="pil")],
|
17 |
+
title="Vision Transformer Segmentation & Depth Estimation",
|
18 |
+
description="Upload an image to apply segmentation and lens blur effects."
|
19 |
+
)
|
20 |
+
|
21 |
+
app.launch()
|