Ashoka74 commited on
Commit
ab2e5eb
1 Parent(s): 8c9f549

Update app_3.py

Browse files
Files changed (1) hide show
  1. app_3.py +1 -1
app_3.py CHANGED
@@ -1501,7 +1501,7 @@ def process_image(input_image, input_text):
1501
 
1502
  # Create RGBA image with default 255 alpha
1503
  alpha = np.zeros((H, W, 1), dtype=np.uint8)
1504
- alpha[~first_mask] = 128 # Set semi-transparency for background
1505
  alpha[first_mask] = 255 # Make the foreground opaque
1506
  alpha = alpha.squeeze(-1) # Remove singleton dimension to become 2D
1507
  rgba = np.dstack((img, alpha)).astype(np.uint8)
 
1501
 
1502
  # Create RGBA image with default 255 alpha
1503
  alpha = np.zeros((H, W, 1), dtype=np.uint8)
1504
+ alpha[~first_mask] = 0 # 128 for semi-transparency background
1505
  alpha[first_mask] = 255 # Make the foreground opaque
1506
  alpha = alpha.squeeze(-1) # Remove singleton dimension to become 2D
1507
  rgba = np.dstack((img, alpha)).astype(np.uint8)