Update app.py
Browse files
app.py
CHANGED
|
@@ -448,22 +448,6 @@ def enhanced_composite_with_sam(original_image, inpaint_result, original_mask,
|
|
| 448 |
# putalpha macht das Inpaint-bild an den Stellen transparent an denen die SAM-Maske schwarz ist!
|
| 449 |
edited_rgba.putalpha(alpha_mask)
|
| 450 |
|
| 451 |
-
# DEBUG: Prüfe wirklich was drin ist
|
| 452 |
-
alpha_channel = edited_rgba.getchannel('A')
|
| 453 |
-
alpha_values = np.array(alpha_channel)
|
| 454 |
-
print(f"🔍 Finaler Alpha unique: {np.unique(alpha_values)}")
|
| 455 |
-
print(f"🔍 Finaler Alpha Min/Max: {alpha_values.min()}, {alpha_values.max()}")
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
white_pixels = np.sum(np.array(alpha_mask) == 255)
|
| 459 |
-
black_pixels = np.sum(np.array(alpha_mask) == 0)
|
| 460 |
-
total_pixels = white_pixels + black_pixels
|
| 461 |
-
print(f"🔍 Alpha-Mask Statistik: Weiß={white_pixels} ({white_pixels/total_pixels*100:.1f}%), Schwarz={black_pixels} ({black_pixels/total_pixels*100:.1f}%)")
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
print(f"🔍 Alpha-Maske Werte: min={np.array(alpha_mask).min()}, max={np.array(alpha_mask).max()}")
|
| 465 |
-
print(f"🔍 Generierte Person Alpha: {edited_rgba.getchannel('A').getextrema()}")
|
| 466 |
-
|
| 467 |
# hiermit hole ich mir den Hintergrund außerhalb der BBox zurück
|
| 468 |
final_image.paste(edited_rgba, (bbox_coords[0], bbox_coords[1]), edited_rgba)
|
| 469 |
|
|
|
|
| 448 |
# putalpha macht das Inpaint-bild an den Stellen transparent an denen die SAM-Maske schwarz ist!
|
| 449 |
edited_rgba.putalpha(alpha_mask)
|
| 450 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
# hiermit hole ich mir den Hintergrund außerhalb der BBox zurück
|
| 452 |
final_image.paste(edited_rgba, (bbox_coords[0], bbox_coords[1]), edited_rgba)
|
| 453 |
|