Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,14 +5,8 @@ from PIL import Image
|
|
| 5 |
import torch
|
| 6 |
def predict(input_img):
|
| 7 |
input_img = Image.fromarray(np.uint8(input_img))
|
| 8 |
-
model1 =
|
| 9 |
-
|
| 10 |
-
drop_rate=0.5,
|
| 11 |
-
num_classes=1,)
|
| 12 |
-
model2 = create_model(
|
| 13 |
-
'resnet50',
|
| 14 |
-
drop_rate=0.5,
|
| 15 |
-
num_classes=1,)
|
| 16 |
|
| 17 |
loc = 'cuda:{}'.format(0)
|
| 18 |
checkpoint1 = torch.load("./machine_full_best.tar", map_location=loc)
|
|
|
|
| 5 |
import torch
|
| 6 |
def predict(input_img):
|
| 7 |
input_img = Image.fromarray(np.uint8(input_img))
|
| 8 |
+
model1 = models.__dict__['resnet50'](drop_rate=0.5,num_classes=1,)
|
| 9 |
+
model2 = models.__dict__['resnet50'](drop_rate=0.5,num_classes=1,)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
loc = 'cuda:{}'.format(0)
|
| 12 |
checkpoint1 = torch.load("./machine_full_best.tar", map_location=loc)
|