Spaces:
Running
on
T4
Running
on
T4
try fixing when model_type is None
Browse files
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(
|
|
|
|
| 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()
|