Spaces:
Running
on
Zero
Running
on
Zero
Update app_3.py
Browse files
app_3.py
CHANGED
@@ -1402,7 +1402,7 @@ def process_image(input_image, input_text):
|
|
1402 |
|
1403 |
# Create RGBA image with default 255 alpha
|
1404 |
alpha = np.zeros((H, W, 1), dtype=np.uint8)
|
1405 |
-
alpha[~first_mask] = 128 #
|
1406 |
alpha[first_mask] = 255 # Make the foreground opaque
|
1407 |
alpha = alpha.squeeze(-1) # Remove singleton dimension to become 2D
|
1408 |
rgba = np.dstack((img, alpha)).astype(np.uint8)
|
|
|
1402 |
|
1403 |
# Create RGBA image with default 255 alpha
|
1404 |
alpha = np.zeros((H, W, 1), dtype=np.uint8)
|
1405 |
+
alpha[~first_mask] = 0 # 128 # for semi-transparency background
|
1406 |
alpha[first_mask] = 255 # Make the foreground opaque
|
1407 |
alpha = alpha.squeeze(-1) # Remove singleton dimension to become 2D
|
1408 |
rgba = np.dstack((img, alpha)).astype(np.uint8)
|