Object detection API
Return object classes, counts and bounding boxes from camera images.
What it detects
Add people and vehicle overlays to your application.
Camera setup
Set detections.return_boxes to true. Filter by the supported classes you need and choose a min_confidence between 0.05 and 0.95.
Send a camera image.
Set KIRKWOOD_API_KEY on your server. Save a frame as frame.jpg.
import base64
import json
import os
import urllib.request
with open("frame.jpg", "rb") as frame:
image = base64.b64encode(frame.read()).decode()
body = json.loads('''{
"images": [
"<BASE64_JPEG>"
],
"pipeline": "detector",
"detections": {
"classes": [
"person",
"car"
],
"return_boxes": true,
"min_confidence": 0.3
}
}''')
body["images"] = [image]
request = urllib.request.Request(
"https://app.kirkwood.ai/v1/analyze",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["KIRKWOOD_API_KEY"],
"Content-Type": "application/json",
},
method="POST",
)
with urllib.request.urlopen(request, timeout=120) as response:
print(json.dumps(json.load(response), indent=2))Read the result
Each detection includes class, score, pixel coordinates and normalized coordinates. Use the image dimensions to draw boxes at the correct scale.
Try it on your footage.
Upload an image and choose the detector pipeline. Run analysis.
Approved account required. Analysis uses credit. Images are retained for annotation and training.
Open the live PlaygroundBefore you integrate
Object boxes locate detector classes. Incident tags such as fighting and fire are separate image-level assessments; they are not object box classes.
Can I get incident analysis in the same call?
Yes. Remove pipeline: detector, add the incident tags you want and keep return_boxes enabled. The default full pipeline returns both.