oussamab2n commited on
Commit
9f64f19
·
verified ·
1 Parent(s): 8d7ae39

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -121,9 +121,9 @@ def _patched_load_fixation_csv(csv_path, image_width=1, image_height=1, image_na
121
 
122
  fixations = _torch.tensor(
123
  list(zip(x_n, y_n, dur_n)), dtype=_torch.float32
124
- ) # (N, 3)
125
- print(f"[PATCH] injecting {len(fixations)} fixations")
126
- print(f"[PATCH] fixation tensor (x_norm, y_norm, dur_norm):\n{fixations}")
127
  return fixations
128
 
129
  _predict_module.load_fixation_csv = _patched_load_fixation_csv
@@ -344,4 +344,4 @@ with gr.Blocks(title="GazeRefine — gaze-guided zero-shot segmentation") as dem
344
  "foreground/background refinement, entirely training-free."
345
  )
346
 
347
- demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True)
 
121
 
122
  fixations = _torch.tensor(
123
  list(zip(x_n, y_n, dur_n)), dtype=_torch.float32
124
+ ).unsqueeze(0) # (N, 3) → (1, N, 3) — model expects a batch dimension
125
+ print(f"[PATCH] injecting {fixations.shape[1]} fixations, tensor shape: {tuple(fixations.shape)}")
126
+ print(f"[PATCH] fixation tensor (x_norm, y_norm, dur_norm):\n{fixations[0]}")
127
  return fixations
128
 
129
  _predict_module.load_fixation_csv = _patched_load_fixation_csv
 
344
  "foreground/background refinement, entirely training-free."
345
  )
346
 
347
+ demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True)