opsiclear-admin commited on
Commit
9b4ce7a
·
verified ·
1 Parent(s): 2ccba64

Fix darkened texture: lower alpha threshold from 0.5 to 0.05

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -377,7 +377,7 @@ def preprocess_image(input: Image.Image) -> Image.Image:
377
  output = output.crop(bbox) # type: ignore
378
  output_np = np.array(output)
379
  alpha = output_np[:, :, 3]
380
- output_np[:, :, :3][alpha < 0.5 * 255] = [0, 0, 0]
381
  output = Image.fromarray(output_np[:, :, :3])
382
  return output
383
 
 
377
  output = output.crop(bbox) # type: ignore
378
  output_np = np.array(output)
379
  alpha = output_np[:, :, 3]
380
+ output_np[:, :, :3][alpha < 0.05 * 255] = [0, 0, 0]
381
  output = Image.fromarray(output_np[:, :, :3])
382
  return output
383