Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 721 |
# Rind fill: Green
|
| 722 |
-
out[..., 0] = np.where(
|
| 723 |
-
out[..., 1] = np.where(
|
| 724 |
-
out[..., 2] = np.where(
|
| 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])
|