Spill detection API
Detect spills, scattered litter and other visible cleanup needs from cameras.
What it detects
Check food courts, walkways and shared spaces for spilled drinks, food or litter.
- Detection
- A spilled drink or food, litter scattered on the ground, dog waste, an overflowing trash can or bags piled beside it, food-court tables left with trash.
- Outside the definition
- Clean ground. Rain-wet ground, leaves, a dog with no mess.
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>"
],
"tags": [
"cleanup_needed"
],
"detections": {
"return_boxes": true
}
}''')
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
Read tags.cleanup_needed.answer and p_yes. The same tag covers spills, scattered litter, overflowing bins and other listed cleanup needs.
Camera setup
Test the floor materials and lighting found at your property. Include reflections and rain-wet surfaces in your comparisons.
Try it on your footage.
Upload an image and select “Cleanup needed”. Run analysis.
Approved account required. Analysis uses credit. Images are retained for annotation and training.
Open the live PlaygroundBefore you integrate
This is a broad cleanup tag, not a liquid-only classifier. Rain-wet ground and ordinary leaves are outside its positive definition.
Can it distinguish a spill from litter?
The catalog returns one cleanup_needed result for either. A custom question can ask a more specific question, but custom questions are experimental.