Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,8 +93,8 @@ def apply_depth_based_blur_background(image, mask, strength):
|
|
| 93 |
|
| 94 |
def segment_and_blur(input_image, blur_type, gaussian_radius=15, lens_strength=5):
|
| 95 |
try:
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
image = input_image.convert("RGB")
|
| 100 |
image = image.rotate(-90, expand=True)
|
|
@@ -135,6 +135,7 @@ def segment_and_blur(input_image, blur_type, gaussian_radius=15, lens_strength=5
|
|
| 135 |
return f"Error during processing: {str(e)}"
|
| 136 |
|
| 137 |
|
|
|
|
| 138 |
iface = gr.Interface(
|
| 139 |
fn=segment_and_blur,
|
| 140 |
inputs=[
|
|
|
|
| 93 |
|
| 94 |
def segment_and_blur(input_image, blur_type, gaussian_radius=15, lens_strength=5):
|
| 95 |
try:
|
| 96 |
+
if oneformer_processor is None or oneformer_model is None:
|
| 97 |
+
return "Error: OneFormer model not loaded." # <-- Fix indentation here
|
| 98 |
|
| 99 |
image = input_image.convert("RGB")
|
| 100 |
image = image.rotate(-90, expand=True)
|
|
|
|
| 135 |
return f"Error during processing: {str(e)}"
|
| 136 |
|
| 137 |
|
| 138 |
+
|
| 139 |
iface = gr.Interface(
|
| 140 |
fn=segment_and_blur,
|
| 141 |
inputs=[
|