Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -186,7 +186,8 @@ def run_moondream(image: Image.Image, prompt: str, mode: Literal["point", "objec
|
|
| 186 |
json_output = {}
|
| 187 |
|
| 188 |
if mode == "point":
|
| 189 |
-
|
|
|
|
| 190 |
points = result.get("points", [])
|
| 191 |
json_output = result
|
| 192 |
if points:
|
|
@@ -194,7 +195,8 @@ def run_moondream(image: Image.Image, prompt: str, mode: Literal["point", "objec
|
|
| 194 |
annotated_image = draw_points(annotated_image, rescaled_points)
|
| 195 |
|
| 196 |
elif mode == "object_detection":
|
| 197 |
-
|
|
|
|
| 198 |
boxes = result.get("objects", [])
|
| 199 |
json_output = result
|
| 200 |
if boxes:
|
|
|
|
| 186 |
json_output = {}
|
| 187 |
|
| 188 |
if mode == "point":
|
| 189 |
+
# FIX: Changed 'im' to 'image'
|
| 190 |
+
result = model_md.point(image=image, prompt=prompt)
|
| 191 |
points = result.get("points", [])
|
| 192 |
json_output = result
|
| 193 |
if points:
|
|
|
|
| 195 |
annotated_image = draw_points(annotated_image, rescaled_points)
|
| 196 |
|
| 197 |
elif mode == "object_detection":
|
| 198 |
+
# FIX: Changed 'im' to 'image'
|
| 199 |
+
result = model_md.detect(image=image, prompt=prompt)
|
| 200 |
boxes = result.get("objects", [])
|
| 201 |
json_output = result
|
| 202 |
if boxes:
|