Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ from pathlib import Path
|
|
12 |
import random
|
13 |
import PIL
|
14 |
import torchvision.transforms as transformss
|
|
|
15 |
from albumentations import *
|
16 |
|
17 |
def get_y_fn (x):
|
@@ -76,7 +77,7 @@ def transform_image(image):
|
|
76 |
def predict(img):
|
77 |
img = PIL.Image.fromarray(img, "RGB")
|
78 |
image = transformss.Resize((480,640))(img)
|
79 |
-
tensor = transform_image(image=
|
80 |
|
81 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
82 |
learner.to(device)
|
|
|
12 |
import random
|
13 |
import PIL
|
14 |
import torchvision.transforms as transformss
|
15 |
+
import torch
|
16 |
from albumentations import *
|
17 |
|
18 |
def get_y_fn (x):
|
|
|
77 |
def predict(img):
|
78 |
img = PIL.Image.fromarray(img, "RGB")
|
79 |
image = transformss.Resize((480,640))(img)
|
80 |
+
tensor = transform_image(image=image)
|
81 |
|
82 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
83 |
learner.to(device)
|