ritianyu commited on
Commit
3a76675
·
1 Parent(s): 6c08972

Fix GS task selection

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -85,7 +85,8 @@ APP_ROOT = Path(__file__).resolve().parent
85
  EXAMPLES_DIR = APP_ROOT / "example_data"
86
  INPUT_SIZE = (768, 1024)
87
  APP_NAME = "infinidepth-hf-demo"
88
- TASK_CHOICES = ["Depth", "3DGS"]
 
89
  MODEL_CHOICES = ["InfiniDepth", "InfiniDepth_DepthSensor"]
90
  OUTPUT_MODE_CHOICES = ["upsample", "original", "specific"]
91
  GS_SAMPLE_POINT_NUM = 2000000
@@ -346,7 +347,7 @@ def _select_example(evt: gr.SelectData):
346
 
347
 
348
  def _primary_view_for_task(task_type: str):
349
- selected_tab = GS_VIEW_TAB_ID if task_type == "GS" else DEPTH_VIEW_TAB_ID
350
  return gr.update(selected=selected_tab)
351
 
352
 
@@ -691,7 +692,7 @@ def _run_inference(
691
  cy_org: Optional[float],
692
  request: gr.Request,
693
  ):
694
- if task_type == "GS":
695
  return _run_gs_inference(
696
  image=image,
697
  depth_file=depth_file,
 
85
  EXAMPLES_DIR = APP_ROOT / "example_data"
86
  INPUT_SIZE = (768, 1024)
87
  APP_NAME = "infinidepth-hf-demo"
88
+ GS_TASK_CHOICE = "3DGS"
89
+ TASK_CHOICES = ["Depth", GS_TASK_CHOICE]
90
  MODEL_CHOICES = ["InfiniDepth", "InfiniDepth_DepthSensor"]
91
  OUTPUT_MODE_CHOICES = ["upsample", "original", "specific"]
92
  GS_SAMPLE_POINT_NUM = 2000000
 
347
 
348
 
349
  def _primary_view_for_task(task_type: str):
350
+ selected_tab = GS_VIEW_TAB_ID if task_type == GS_TASK_CHOICE else DEPTH_VIEW_TAB_ID
351
  return gr.update(selected=selected_tab)
352
 
353
 
 
692
  cy_org: Optional[float],
693
  request: gr.Request,
694
  ):
695
+ if task_type == GS_TASK_CHOICE:
696
  return _run_gs_inference(
697
  image=image,
698
  depth_file=depth_file,