Invoke Detection
You invoke a Box Detect function the same way you invoke any Nyckel function — from the console’s Invoke tab, or via the REST API. The difference is the response shape: instead of a single label, you get a list of detected instances of the object the function was trained to find.
Invoke from the console
Open your function and go to the Invoke tab. Upload an image. You’ll see the detected instances overlaid on the image, plus the JSON response.
Invoke from the API
POST https://www.nyckel.com/v1/functions/{functionId}/invoke
Authorization: Bearer {your_access_token}
Content-Type: application/json
{
"data": "https://example.com/photo.jpg"
}
Response:
{
"predictions": [
{
"labelName": "helmet",
"confidence": 0.97,
"boundingBox": { "x": 0.12, "y": 0.18, "width": 0.34, "height": 0.71 }
},
{
"labelName": "helmet",
"confidence": 0.84,
"boundingBox": { "x": 0.55, "y": 0.22, "width": 0.30, "height": 0.68 }
}
]
}
labelName is always the function’s name — every Box Detect function is single-class, so the value is the same on every prediction.
Reading the response
Three things to know:
predictionsis an array. It can be empty. Handle the zero case in your code.- Each prediction has its own confidence. Filter low-confidence detections before acting on them. The right threshold is application-specific.
- Bounding boxes are normalized 0–1.
xandyare the top-left corner;widthandheightare fractions of the image’s width and height. Multiply by the image’s pixel dimensions to get pixel coordinates.
Before you have training data
Box Detect has no useful zero-shot mode. Until you’ve added training images with annotated bounding boxes, the function will typically return no detections at all — that’s expected, not a bug. If you’re seeing empty responses on a brand-new function, head back to Add Training Images and Boxes.
Next
Next Steps — where to go from here.