Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def extract_image(img, pos_prompts, neg_prompts, threshold, blur_radius=5):
|
|
55 |
|
56 |
# apply Gaussian blur for feathering
|
57 |
final_mask_img = Image.fromarray((final_mask * 255).astype(np.uint8), "L")
|
58 |
-
final_mask_img = final_mask_img.filter(
|
59 |
final_mask = np.array(final_mask_img) / 255
|
60 |
final_mask = final_mask > threshold
|
61 |
|
|
|
55 |
|
56 |
# apply Gaussian blur for feathering
|
57 |
final_mask_img = Image.fromarray((final_mask * 255).astype(np.uint8), "L")
|
58 |
+
final_mask_img = final_mask_img.filter(ImageFilter.GaussianBlur(radius=blur_radius))
|
59 |
final_mask = np.array(final_mask_img) / 255
|
60 |
final_mask = final_mask > threshold
|
61 |
|