Spaces:
Sleeping
Sleeping
update confidence score
Browse files
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.
|
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__':
|