Skip to main content

Point

The /point endpoint provides precise coordinate locations for specific objects in images. Unlike /detect which returns bounding boxes, this endpoint returns center points for each instance of the specified object.

Example Request

import moondream as md
from PIL import Image
import matplotlib.pyplot as plt

# Initialize with API key
model = md.vl(api_key="your-api-key")

# Load an image
image = Image.open("path/to/image.jpg")

# Locate objects (e.g., "person", "car", "face", etc.)
result = model.point(image, "face")
points = result["points"]
request_id = result["request_id"]
print(f"Found {len(points)} faces")
print(f"Request ID: {request_id}")

# Visualize the points
plt.figure(figsize=(10, 10))
plt.imshow(image)

for point in points:
# Convert normalized coordinates to pixel values
x = point["x"] * image.width
y = point["y"] * image.height

# Plot the point
plt.plot(x, y, 'ro', markersize=15, alpha=0.7)
plt.text(
x + 10, y, "Face",
color='white', fontsize=12,
bbox=dict(facecolor='red', alpha=0.5)
)

plt.axis('off')
plt.savefig("output_with_points.jpg")
plt.show()

Example Response

{
"request_id": "2025-03-25_point_2025-03-25-21:00:39-715d03",
"points": [
{
"x": 0.65,
"y": 0.42
}
]
}

Parameters

FieldTypeRequiredDescription
modelstringYesModel ID. Supported values include moondream3.1-9B-A2B, moondream3-preview, or a saved finetuned checkpoint in {base_model}/{finetune_id}@{step} format.
image_urlstringYesBase64 data URL for the input image.
objectstringYesObject or visual phrase to locate.

Point vs. Detect

  • /point returns center coordinates only (x, y)
  • /detect returns bounding boxes (x_min, y_min, x_max, y_max)

Use /point when you need:

  • Precise object center points
  • Simpler data for plotting
  • Multiple instance counting

Use /detect when you need:

  • Object size information
  • Visual highlighting of complete objects
  • Cropping regions of interest

Learn More: