crabbly commited on
Commit
475bba9
·
verified ·
1 Parent(s): 3afd2b7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -4
main.py CHANGED
@@ -717,11 +717,15 @@ class WatermelonProcessor:
717
 
718
  def draw_base(r_m, f_m):
719
  out = image.copy().astype(np.float32)
720
- alpha = 0.21 # Half transparency
 
 
 
 
721
  # Rind fill: Green
722
- out[..., 0] = np.where(r_m > 0, out[..., 0]*(1-alpha) + 0, out[..., 0])
723
- out[..., 1] = np.where(r_m > 0, out[..., 1]*(1-alpha) + 170, out[..., 1])
724
- out[..., 2] = np.where(r_m > 0, out[..., 2]*(1-alpha) + 0, out[..., 2])
725
 
726
  # Flesh fill: Red
727
  out[..., 0] = np.where(f_m > 0, out[..., 0]*(1-alpha) + 0, out[..., 0])
 
717
 
718
  def draw_base(r_m, f_m):
719
  out = image.copy().astype(np.float32)
720
+ alpha = 0.15 # Transparency
721
+
722
+ # --- THE FIX: Only paint the rind where there is NO flesh ---
723
+ rind_only = (r_m > 0) & (f_m == 0)
724
+
725
  # Rind fill: Green
726
+ out[..., 0] = np.where(rind_only, out[..., 0]*(1-alpha) + 0, out[..., 0])
727
+ out[..., 1] = np.where(rind_only, out[..., 1]*(1-alpha) + 170, out[..., 1])
728
+ out[..., 2] = np.where(rind_only, out[..., 2]*(1-alpha) + 0, out[..., 2])
729
 
730
  # Flesh fill: Red
731
  out[..., 0] = np.where(f_m > 0, out[..., 0]*(1-alpha) + 0, out[..., 0])