Vizuara commited on
Commit
5301c86
·
verified ·
1 Parent(s): 38f28fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -29,7 +29,7 @@ def predict(image):
29
  with torch.no_grad():
30
  pred = model(img)
31
  mask = pred.squeeze(0).squeeze(0).cpu().numpy()
32
- mask = (mask > 0.5).astype(np.uint8) * 255 # binarize to 0/255
33
  return Image.fromarray(mask)
34
 
35
  # Gradio interface
 
29
  with torch.no_grad():
30
  pred = model(img)
31
  mask = pred.squeeze(0).squeeze(0).cpu().numpy()
32
+ mask = (mask * 255).astype(np.uint8) # keep gray levels
33
  return Image.fromarray(mask)
34
 
35
  # Gradio interface