Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from torch.utils.data import Dataset, DataLoader
|
|
4 |
import torchvision
|
5 |
from PIL import Image
|
6 |
import gradio as gr
|
|
|
7 |
|
8 |
# Configure device
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
@@ -14,7 +15,11 @@ transform = torchvision.transforms.Compose([
|
|
14 |
torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.225, 0.225, 0.225])
|
15 |
])
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
model = model.to(device)
|
19 |
|
20 |
classes = ["chmury", 'inne', "dym"]
|
|
|
4 |
import torchvision
|
5 |
from PIL import Image
|
6 |
import gradio as gr
|
7 |
+
from huggingface_hub import hf_hub_download
|
8 |
|
9 |
# Configure device
|
10 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
15 |
torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.225, 0.225, 0.225])
|
16 |
])
|
17 |
|
18 |
+
REPO_ID = "Raaniel/model-smoke"
|
19 |
+
MODEL_FILE_NAME = "model_smoke.pt"
|
20 |
+
checkpoint_path = hf_hub_download(repo_id=REPO_ID, filename=MODEL_FILE_NAME)
|
21 |
+
|
22 |
+
model = torch.jit.load(checkpoint_path)
|
23 |
model = model.to(device)
|
24 |
|
25 |
classes = ["chmury", 'inne', "dym"]
|