Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -146,15 +146,16 @@ def segment_and_blur(input_image, blur_type, gaussian_radius=15, lens_strength=5
|
|
146 |
iface = gr.Interface(
|
147 |
fn=segment_and_blur,
|
148 |
inputs=[
|
149 |
-
gr.Image(label="Input Image"),
|
150 |
gr.Radio(["Gaussian", "Lens"], label="Blur Type", value="Gaussian"),
|
151 |
-
gr.Slider(0, 30, step=1, value=15, label="Gaussian Blur Radius"),
|
152 |
-
gr.Slider(0, 10, step=1, value=5, label="Lens Blur Strength"),
|
153 |
],
|
154 |
outputs=gr.Image(label="Output Image"),
|
155 |
title="Image Background Blur App",
|
156 |
description="Upload an image, select a blur type (Gaussian or Lens), and adjust the blur parameters to blur the background while keeping the person in focus."
|
157 |
)
|
158 |
|
|
|
159 |
if __name__ == "__main__":
|
160 |
iface.launch()
|
|
|
146 |
iface = gr.Interface(
|
147 |
fn=segment_and_blur,
|
148 |
inputs=[
|
149 |
+
gr.Image(type="pil", label="Input Image"), # <-- ADD type="pil" here
|
150 |
gr.Radio(["Gaussian", "Lens"], label="Blur Type", value="Gaussian"),
|
151 |
+
gr.Slider(0, 30, step=1, value=15, label="Gaussian Blur Radius"),
|
152 |
+
gr.Slider(0, 10, step=1, value=5, label="Lens Blur Strength"),
|
153 |
],
|
154 |
outputs=gr.Image(label="Output Image"),
|
155 |
title="Image Background Blur App",
|
156 |
description="Upload an image, select a blur type (Gaussian or Lens), and adjust the blur parameters to blur the background while keeping the person in focus."
|
157 |
)
|
158 |
|
159 |
+
|
160 |
if __name__ == "__main__":
|
161 |
iface.launch()
|