Spaces:
Sleeping
Sleeping
Nunzio commited on
Commit ·
025a944
1
Parent(s): 3f820ff
simpler model loading
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import torch
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
from utils.imageHandling import hfImageToTensor, preprocessing, postprocessing, loadPreloadedImages, legendHandling
|
| 5 |
-
from model.modelLoading import
|
| 6 |
|
| 7 |
|
| 8 |
## %% CONSTANTS
|
|
@@ -13,10 +13,10 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
| 13 |
|
| 14 |
|
| 15 |
MODELS = {
|
| 16 |
-
"BISENET-BASE":
|
| 17 |
-
"BISENET-BEST":
|
| 18 |
-
"BISENETV2-BASE":
|
| 19 |
-
"BISENETV2-BEST":
|
| 20 |
}
|
| 21 |
|
| 22 |
image_list = loadPreloadedImages(gta_image_dir, city_image_dir, turin_image_dir)
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
from utils.imageHandling import hfImageToTensor, preprocessing, postprocessing, loadPreloadedImages, legendHandling
|
| 5 |
+
from model.modelLoading import loadModel
|
| 6 |
|
| 7 |
|
| 8 |
## %% CONSTANTS
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
MODELS = {
|
| 16 |
+
"BISENET-BASE": loadModel('bisenet', device, 'weight_Base.pth'),
|
| 17 |
+
"BISENET-BEST": loadModel('bisenet', device, 'weight_Best.pth'),
|
| 18 |
+
"BISENETV2-BASE": loadModel('bisenetv2', device, 'weight_Base.pth'),
|
| 19 |
+
"BISENETV2-BEST": loadModel('bisenetv2', device, 'weight_Best.pth')
|
| 20 |
}
|
| 21 |
|
| 22 |
image_list = loadPreloadedImages(gta_image_dir, city_image_dir, turin_image_dir)
|