Perception

Detect objects

Find objects by name in an image and get a labelled box for each.

View as Markdown
POST/v1/detect

Authorization

Request body

JSON, with Content-Type: application/json.

  • modelstringrequired

    The detection model to run, e.g. idea-research/grounding-dino. The live models for this endpoint are listed below.

  • imagestringrequired

    The image, base64 JPEG or PNG (a data: URL works too). Under 4 MB of base64.

  • labelsstring[]required

    What to look for, e.g. ["cup", "bowl"]. 1–50 names, each up to 200 characters.

Response

  • idstring

    Unique id of this call, e.g. det_48213. It matches the call in your Activity dashboard.

  • modelstring

    The model that answered.

  • backendstring

    "http": the real model ran on a GPU. "simulated": stand-in output of the same shape, as test keys get.

  • sandboxboolean

    true when the call was made with a test key: the output is simulated, nothing ran on a GPU and nothing was charged. Absent otherwise.

  • detectionsobject[]

    One per object found.

    Show 3 child attributes
    • labelstring

      Which of your labels it matched.

    • scorenumber

      Confidence, 0–1.

    • boxnumber[4]

      [x0, y0, x1, y1] in pixels.

  • usageobject

    What the call cost.

    Show 2 child attributes
    • cost_usdnumber

      Charged to your credits, in US dollars.

    • latency_msinteger

      Time the model took, in milliseconds.

Errors

The errors every endpoint shares: invalid input, keys, credits and cold starts. See Errors.

Models

7 live models for /detect. Each page has a ready-made request.

1 more is coming soon. See the models page.