Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import torch
|
| 4 |
from torchvision import models, transforms
|
| 5 |
from PIL import Image
|
| 6 |
-
|
| 7 |
# -- get torch and cuda version
|
| 8 |
TORCH_VERSION = ".".join(torch.__version__.split(".")[:2])
|
| 9 |
CUDA_VERSION = torch.__version__.split("+")[-1]
|
|
@@ -38,7 +38,7 @@ outputs = predictor(im)
|
|
| 38 |
|
| 39 |
print(outputs["instances"].pred_classes)
|
| 40 |
print(outputs["instances"].pred_boxes)
|
| 41 |
-
|
| 42 |
# -- load Mask R-CNN model for segmentation
|
| 43 |
DesignModernityModel = torch.load("DesignModernityModel.pt")
|
| 44 |
|
|
@@ -47,7 +47,7 @@ DesignModernityModel = torch.load("DesignModernityModel.pt")
|
|
| 47 |
|
| 48 |
DesignModernityModel.eval() # set state of the model to inference
|
| 49 |
|
| 50 |
-
LABELS = ['2000-
|
| 51 |
n_labels = len(LABELS)
|
| 52 |
|
| 53 |
MEAN = [0.485, 0.456, 0.406]
|
|
|
|
| 3 |
import torch
|
| 4 |
from torchvision import models, transforms
|
| 5 |
from PIL import Image
|
| 6 |
+
|
| 7 |
# -- get torch and cuda version
|
| 8 |
TORCH_VERSION = ".".join(torch.__version__.split(".")[:2])
|
| 9 |
CUDA_VERSION = torch.__version__.split("+")[-1]
|
|
|
|
| 38 |
|
| 39 |
print(outputs["instances"].pred_classes)
|
| 40 |
print(outputs["instances"].pred_boxes)
|
| 41 |
+
|
| 42 |
# -- load Mask R-CNN model for segmentation
|
| 43 |
DesignModernityModel = torch.load("DesignModernityModel.pt")
|
| 44 |
|
|
|
|
| 47 |
|
| 48 |
DesignModernityModel.eval() # set state of the model to inference
|
| 49 |
|
| 50 |
+
LABELS = ['2000-2003', '2006-2008', '2009-2011', '2012-2014', '2015-2018']
|
| 51 |
n_labels = len(LABELS)
|
| 52 |
|
| 53 |
MEAN = [0.485, 0.456, 0.406]
|