Update app.py
Browse files
app.py
CHANGED
|
@@ -419,11 +419,14 @@ def enhanced_composite_with_sam(original_image, inpaint_result, original_mask,
|
|
| 419 |
soft_mask = mask_cropped.filter(ImageFilter.GaussianBlur(3))
|
| 420 |
|
| 421 |
# DEBUG: Prüfe welche Werte die Maske hat
|
| 422 |
-
|
|
|
|
|
|
|
|
|
|
| 423 |
|
| 424 |
|
| 425 |
# Binarisieren für klare Alpha-Werte (nur 0 oder 255)
|
| 426 |
-
threshold =
|
| 427 |
alpha_mask = soft_mask.point(lambda x: 255 if x > threshold else 0)
|
| 428 |
print(f"🔍 Alpha-Mask unique values: {np.unique(np.array(alpha_mask))}")
|
| 429 |
|
|
|
|
| 419 |
soft_mask = mask_cropped.filter(ImageFilter.GaussianBlur(3))
|
| 420 |
|
| 421 |
# DEBUG: Prüfe welche Werte die Maske hat
|
| 422 |
+
# DEBUG: Prüfe soft_mask
|
| 423 |
+
print(f"🔍 Soft-Mask unique values PRE: {np.unique(np.array(soft_mask))[:20]}")
|
| 424 |
+
print(f"🔍 Soft-Mask Min/Max: {np.array(soft_mask).min()}, {np.array(soft_mask).max()}")
|
| 425 |
+
|
| 426 |
|
| 427 |
|
| 428 |
# Binarisieren für klare Alpha-Werte (nur 0 oder 255)
|
| 429 |
+
threshold = 5
|
| 430 |
alpha_mask = soft_mask.point(lambda x: 255 if x > threshold else 0)
|
| 431 |
print(f"🔍 Alpha-Mask unique values: {np.unique(np.array(alpha_mask))}")
|
| 432 |
|