Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,6 @@ from torchvision import transforms
|
|
4 |
import torch
|
5 |
import PIL
|
6 |
from streamlit_image_select import image_select
|
7 |
-
import pathlib
|
8 |
-
import platform
|
9 |
-
plt = platform.system()
|
10 |
-
if plt == 'Linux':
|
11 |
-
pathlib.WindowsPath = pathlib.PosixPath
|
12 |
|
13 |
#Transforming the Input Image
|
14 |
img_transform = transforms.Compose([
|
@@ -17,8 +12,7 @@ img_transform = transforms.Compose([
|
|
17 |
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
18 |
])
|
19 |
#Loading the model
|
20 |
-
|
21 |
-
model = torch.load(model_pth, map_location=torch.device('cpu'))
|
22 |
model.eval()
|
23 |
|
24 |
#Mushroom Classes
|
|
|
4 |
import torch
|
5 |
import PIL
|
6 |
from streamlit_image_select import image_select
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
#Transforming the Input Image
|
9 |
img_transform = transforms.Compose([
|
|
|
12 |
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
13 |
])
|
14 |
#Loading the model
|
15 |
+
model = torch.load("model/MobileNet_v3.pt", map_location=torch.device('cpu'))
|
|
|
16 |
model.eval()
|
17 |
|
18 |
#Mushroom Classes
|