Nunzio commited on
Commit
025a944
·
1 Parent(s): 3f820ff

simpler model loading

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 loadBiSeNet, loadBiSeNetV2
6
 
7
 
8
  ## %% CONSTANTS
@@ -13,10 +13,10 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
13
 
14
 
15
  MODELS = {
16
- "BISENET-BASE": loadBiSeNet('bisenet', device, 'weight_Base.pth'),
17
- "BISENET-BEST": loadBiSeNet('bisenet', device, 'weight_Best.pth'),
18
- "BISENETV2-BASE": loadBiSeNetV2('bisenetv2', device, 'weight_Base.pth'),
19
- "BISENETV2-BEST": loadBiSeNetV2('bisenetv2', device, 'weight_Best.pth')
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)