Spaces:
Sleeping
Sleeping
update stuff
Browse files
app.py
CHANGED
@@ -31,9 +31,11 @@ state_dict = torch.load('model.pth', map_location='cpu')
|
|
31 |
model.load_state_dict(state_dict, strict=False)
|
32 |
model.eval()
|
33 |
|
34 |
-
def predict(
|
35 |
-
|
36 |
-
|
|
|
|
|
37 |
x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
|
38 |
|
39 |
with torch.no_grad():
|
|
|
31 |
model.load_state_dict(state_dict, strict=False)
|
32 |
model.eval()
|
33 |
|
34 |
+
def predict(image):
|
35 |
+
image = image['composite']
|
36 |
+
image = transforms.Resize((28, 28))(image)
|
37 |
+
print(image)
|
38 |
+
|
39 |
x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
|
40 |
|
41 |
with torch.no_grad():
|