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

Update app_3.py

Browse files
Files changed (1) hide show
  1. app_3.py +1 -1
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 # Set semi-transparency for 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)
 
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)