freealise commited on
Commit
9ef6880
·
verified ·
1 Parent(s): bc128a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -218,6 +218,7 @@ def remove_bg(fl, count, mh, ms, md, lm):
218
  a_map = cv2.imread(f"{str(count)}_cutout.png", cv2.IMREAD_UNCHANGED).astype(np.uint8)
219
  B, G, R, A = cv2.split(a_map)
220
  alpha = A / 255
 
221
  R = (255 * (1 - alpha) + R * alpha).astype(np.uint8)
222
  G = (255 * (1 - alpha) + G * alpha).astype(np.uint8)
223
  B = (255 * (1 - alpha) + B * alpha).astype(np.uint8)
 
218
  a_map = cv2.imread(f"{str(count)}_cutout.png", cv2.IMREAD_UNCHANGED).astype(np.uint8)
219
  B, G, R, A = cv2.split(a_map)
220
  alpha = A / 255
221
+ alpha[A<255] = alpha[A<255] / 17
222
  R = (255 * (1 - alpha) + R * alpha).astype(np.uint8)
223
  G = (255 * (1 - alpha) + G * alpha).astype(np.uint8)
224
  B = (255 * (1 - alpha) + B * alpha).astype(np.uint8)