oshita-n commited on
Commit
dc972bb
1 Parent(s): 5805862

update confidence score

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -10,10 +10,9 @@ def process(input_image, prompt):
10
  with torch.no_grad():
11
  outputs = model(**inputs)
12
  preds = torch.sigmoid(outputs.logits).squeeze().detach().cpu().numpy()
13
- preds = np.where(preds > 0.5, 255, 0).astype(np.uint8)
14
  preds = Image.fromarray(preds.astype(np.uint8))
15
  preds = np.array(preds.resize((input_image.width, input_image.height)))
16
- print(preds)
17
  return preds
18
 
19
  if __name__ == '__main__':
 
10
  with torch.no_grad():
11
  outputs = model(**inputs)
12
  preds = torch.sigmoid(outputs.logits).squeeze().detach().cpu().numpy()
13
+ preds = np.where(preds > 0.3, 255, 0).astype(np.uint8)
14
  preds = Image.fromarray(preds.astype(np.uint8))
15
  preds = np.array(preds.resize((input_image.width, input_image.height)))
 
16
  return preds
17
 
18
  if __name__ == '__main__':