Model changed and weights
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
-
from PIL import Image
|
3 |
import torch
|
4 |
import torchvision.transforms as transforms
|
5 |
import numpy as np
|
6 |
|
7 |
-
from
|
|
|
8 |
|
9 |
|
10 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
@@ -13,11 +13,11 @@ pil_to_tensor = transforms.ToTensor()
|
|
13 |
|
14 |
# define some parameters based on the run we want to make
|
15 |
|
16 |
-
model =
|
17 |
|
18 |
-
checkpoints = torch.load('./
|
19 |
|
20 |
-
model.load_state_dict(checkpoints['
|
21 |
|
22 |
model = model.to(device)
|
23 |
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
import torchvision.transforms as transforms
|
4 |
import numpy as np
|
5 |
|
6 |
+
from PIL import Image
|
7 |
+
from model.flol import create_model
|
8 |
|
9 |
|
10 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
|
|
13 |
|
14 |
# define some parameters based on the run we want to make
|
15 |
|
16 |
+
model = create_model()
|
17 |
|
18 |
+
checkpoints = torch.load('./weights/flolv2_UHDLL.pt', map_location=device)
|
19 |
|
20 |
+
model.load_state_dict(checkpoints['params'])
|
21 |
|
22 |
model = model.to(device)
|
23 |
|