mangaruu commited on
Commit
d973f96
·
1 Parent(s): c4ee370

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -39,13 +39,17 @@ models = [
39
 
40
  def setup_model(config_file, model_path=None):
41
  cfg = get_cfg()
42
- cfg.merge_from_file(config_file)
43
- if model_path:
44
- cfg.MODEL.WEIGHTS = model_path
45
- else:
46
  cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(config_file)
 
 
 
 
47
  if not torch.cuda.is_available():
48
  cfg.MODEL.DEVICE = "cpu"
 
49
  return cfg
50
 
51
  for model in models:
 
39
 
40
  def setup_model(config_file, model_path=None):
41
  cfg = get_cfg()
42
+
43
+ if not model_path:
44
+ cfg.merge_from_file(model_zoo.get_config_file(config_file))
 
45
  cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(config_file)
46
+ else:
47
+ cfg.merge_from_file(config_file)
48
+ cfg.MODEL.WEIGHTS = model_path
49
+
50
  if not torch.cuda.is_available():
51
  cfg.MODEL.DEVICE = "cpu"
52
+
53
  return cfg
54
 
55
  for model in models: