Spaces:
Runtime error
Runtime error
shivambhosale
commited on
Commit
•
ad4887b
1
Parent(s):
f9f8b5c
Update make_predictions.py
Browse files- make_predictions.py +1 -1
make_predictions.py
CHANGED
@@ -11,7 +11,7 @@ def make_predictions(model, input_img, threshold = 0.05):
|
|
11 |
image = cv2.resize(image, (256, 256))
|
12 |
image = np.transpose(image, (2, 0, 1))
|
13 |
image = np.expand_dims(image, 0)
|
14 |
-
image = torch.from_numpy(image).to(
|
15 |
predMask = model(image).squeeze()
|
16 |
predMask = torch.sigmoid(predMask)
|
17 |
predMask = predMask.cpu().numpy()
|
|
|
11 |
image = cv2.resize(image, (256, 256))
|
12 |
image = np.transpose(image, (2, 0, 1))
|
13 |
image = np.expand_dims(image, 0)
|
14 |
+
image = torch.from_numpy(image).to('cpu')
|
15 |
predMask = model(image).squeeze()
|
16 |
predMask = torch.sigmoid(predMask)
|
17 |
predMask = predMask.cpu().numpy()
|