Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|