Astridkraft commited on
Commit
86220fb
·
verified ·
1 Parent(s): bc5146d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -444,6 +444,14 @@ def enhanced_composite_with_sam(original_image, inpaint_result, original_mask,
444
  #mask_alpha = mask_inverted.convert("L")
445
 
446
  # Alpha-Kanal setzen (Löcher in die Folie stanzen)
 
 
 
 
 
 
 
 
447
  edited_rgba.putalpha(alpha_mask)
448
 
449
  #mask_rgba = mask_inverted.convert("L") # SAM-Maske als Alpha-Kanal also als Löcherfolie
 
444
  #mask_alpha = mask_inverted.convert("L")
445
 
446
  # Alpha-Kanal setzen (Löcher in die Folie stanzen)
447
+
448
+
449
+ white_pixels = np.sum(np.array(alpha_mask) == 255)
450
+ black_pixels = np.sum(np.array(alpha_mask) == 0)
451
+ total_pixels = white_pixels + black_pixels
452
+ print(f"🔍 Alpha-Mask Statistik: Weiß={white_pixels} ({white_pixels/total_pixels*100:.1f}%), Schwarz={black_pixels} ({black_pixels/total_pixels*100:.1f}%)")
453
+
454
+
455
  edited_rgba.putalpha(alpha_mask)
456
 
457
  #mask_rgba = mask_inverted.convert("L") # SAM-Maske als Alpha-Kanal also als Löcherfolie