Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,16 @@ from fastai.vision.all import *
|
|
4 |
|
5 |
|
6 |
# repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
|
7 |
-
repo_id = "igmarco/grapes-semanticsegmentation"
|
8 |
|
9 |
-
learner = from_pretrained_fastai(repo_id)
|
10 |
|
11 |
import torchvision.transforms as transforms
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
def transform_image(image):
|
14 |
my_transforms = transforms.Compose([transforms.ToTensor(),
|
|
|
4 |
|
5 |
|
6 |
# repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
|
7 |
+
# repo_id = "igmarco/grapes-semanticsegmentation"
|
8 |
|
9 |
+
# learner = from_pretrained_fastai(repo_id)
|
10 |
|
11 |
import torchvision.transforms as transforms
|
12 |
+
import PIL
|
13 |
+
|
14 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
15 |
+
model = torch.jit.load("Pr1.pth")
|
16 |
+
model = model.cpu()
|
17 |
|
18 |
def transform_image(image):
|
19 |
my_transforms = transforms.Compose([transforms.ToTensor(),
|