Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def estimate_depth(image, model_name="depth-anything/Depth-Anything-V2-Small-hf"
|
|
86 |
|
87 |
return depth_map
|
88 |
|
89 |
-
def apply_depth_aware_blur(image, max_sigma=
|
90 |
"""Apply depth-aware blur with farther objects more blurred."""
|
91 |
# Estimate depth (1 = farthest)
|
92 |
depth_map = estimate_depth(image)
|
@@ -110,7 +110,7 @@ def apply_depth_aware_blur(image, max_sigma=0, min_sigma=10):
|
|
110 |
|
111 |
return Image.fromarray(result.astype(np.uint8))
|
112 |
|
113 |
-
def process_image(image, blur_type, sigma=
|
114 |
"""Process image based on blur type."""
|
115 |
# Preprocess image
|
116 |
pil_image = preprocess_image(image)
|
|
|
86 |
|
87 |
return depth_map
|
88 |
|
89 |
+
def apply_depth_aware_blur(image, max_sigma=15, min_sigma=0):
|
90 |
"""Apply depth-aware blur with farther objects more blurred."""
|
91 |
# Estimate depth (1 = farthest)
|
92 |
depth_map = estimate_depth(image)
|
|
|
110 |
|
111 |
return Image.fromarray(result.astype(np.uint8))
|
112 |
|
113 |
+
def process_image(image, blur_type, sigma=15):
|
114 |
"""Process image based on blur type."""
|
115 |
# Preprocess image
|
116 |
pil_image = preprocess_image(image)
|