jinlinyi commited on
Commit
d752c3b
1 Parent(s): 61d15bc

try fixing when model_type is None

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -95,6 +95,8 @@ def resize_fix_aspect_ratio(img, field, target_width=None, target_height=None):
95
 
96
 
97
  def inference(img, model_type):
 
 
98
  perspective_cfg_list = setup_cfg(model_zoo[model_type])
99
  demo = VisualizationDemo(cfg_list=perspective_cfg_list)
100
 
@@ -193,4 +195,4 @@ gr.Interface(
193
  description=description,
194
  article=article,
195
  examples=examples,
196
- ).launch(share=True)
 
95
 
96
 
97
  def inference(img, model_type):
98
+ if model_type is None:
99
+ return None, ""
100
  perspective_cfg_list = setup_cfg(model_zoo[model_type])
101
  demo = VisualizationDemo(cfg_list=perspective_cfg_list)
102
 
 
195
  description=description,
196
  article=article,
197
  examples=examples,
198
+ ).launch()