Spaces:
Runtime error
Runtime error
antonovmaxim
commited on
Commit
·
a523faa
1
Parent(s):
d9b979c
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from torch import nn
|
4 |
from torchvision import transforms
|
5 |
from PIL import Image
|
6 |
-
import os
|
7 |
-
os.system('pip install --upgrade torch torchvision')
|
8 |
-
os.system("wget https://huggingface.co/antonovmaxim/aiornot-kodIIm-14/resolve/main/model.pth -O model.pth")
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
10 |
model = torch.hub.load("pytorch/vision", "resnet101", pretrained=False)
|
11 |
model.fc = nn.Sequential(nn.Linear(2048, 500), nn.ReLU(), nn.Linear(500, 2), nn.Softmax(1))
|
|
|
1 |
+
import os
|
2 |
+
os.system('pip install --upgrade torch torchvision')
|
3 |
+
os.system("wget https://huggingface.co/antonovmaxim/aiornot-kodIIm-14/resolve/main/model.pth -O model.pth")
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
from torch import nn
|
7 |
from torchvision import transforms
|
8 |
from PIL import Image
|
|
|
|
|
|
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
10 |
model = torch.hub.load("pytorch/vision", "resnet101", pretrained=False)
|
11 |
model.fc = nn.Sequential(nn.Linear(2048, 500), nn.ReLU(), nn.Linear(500, 2), nn.Softmax(1))
|