Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,24 @@
|
|
|
|
1 |
import numpy as np
|
2 |
|
3 |
import gradio as gr
|
4 |
import os
|
|
|
|
|
|
|
|
|
|
|
5 |
from PIL import Image
|
6 |
import torch
|
7 |
from torchvision import transforms
|
8 |
from model_video import build_model
|
9 |
import numpy as np
|
10 |
import collections
|
11 |
-
import argparse
|
12 |
|
13 |
net = build_model('cpu').to('cpu')
|
14 |
#net=torch.nn.DataParallel(net)
|
15 |
-
model_path = '
|
16 |
print(model_path)
|
17 |
weight=torch.load(model_path,map_location=torch.device('cpu'))
|
18 |
#print(type(weight))
|
|
|
1 |
+
|
2 |
import numpy as np
|
3 |
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
+
os.system("pip3 install torch")
|
7 |
+
os.system("pip3 install collections")
|
8 |
+
os.system("pip3 install torchvision")
|
9 |
+
#os.system("pip3 install argparse")
|
10 |
+
|
11 |
from PIL import Image
|
12 |
import torch
|
13 |
from torchvision import transforms
|
14 |
from model_video import build_model
|
15 |
import numpy as np
|
16 |
import collections
|
17 |
+
#import argparse
|
18 |
|
19 |
net = build_model('cpu').to('cpu')
|
20 |
#net=torch.nn.DataParallel(net)
|
21 |
+
model_path = 'image_best.pth'
|
22 |
print(model_path)
|
23 |
weight=torch.load(model_path,map_location=torch.device('cpu'))
|
24 |
#print(type(weight))
|