multimodalart HF Staff commited on
Commit
bcd1a57
·
verified ·
1 Parent(s): b6ce26f

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -223,7 +223,11 @@ def run_spatial(image, task, question, options_text, quantity, unit, progress=gr
223
 
224
  prediction = result["prediction"]
225
  if task == "point":
226
- point = prediction[0] if isinstance(prediction, list) else prediction
 
 
 
 
227
  overlay = draw_point(img, point)
228
  else:
229
  overlay = img.copy()
 
223
 
224
  prediction = result["prediction"]
225
  if task == "point":
226
+ # decode_point returns [x, y] (a single point); visual-token variant returns a list of them
227
+ if isinstance(prediction[0], (list, tuple)):
228
+ point = prediction[0]
229
+ else:
230
+ point = prediction
231
  overlay = draw_point(img, point)
232
  else:
233
  overlay = img.copy()