Find objects in a photo with YOLO
Deploy a saved-image detector with wendy run, inspect its outputs, and separate a label from a physical location.
Detect objects
YOLO11n · Runs on your device
Boxes show image positions, not distance.
Use your built-in or USB webcam. Allow camera access when prompted. Video stays in your browser.
Needs a XIAO ESP32-S3 Sense on USB that runs Wendy’s SensorLink firmware. Install the firmware.
Choose an image, then run detection.
Model & download details
The first run downloads the 10.7 MB model and WASM runtime. Inference runs on your CPU through our yzma fork. Model license. Sample photograph: Wendy Labs.
Opening the Python editor…
Requirements and learning goals
Before you start
- Wendy CLI and Docker on your computer
- A prepared Linux Wendy target or Wendy VM
- A photograph containing common objects
You will be able to
- Deploy image inference with wendy run
- Inspect boxes and confidence
- Recognize vocabulary limits
, short for "You Only Look Once," is a family of object-detection models. A detector predicts a class, a , and a confidence score for objects in an image. It can give a robot a first clue about what is nearby, but a box does not tell you the object's distance.
Start with the browser exercise above. It runs actual YOLO11n on the sample image or your photograph using the backend in our yzma fork. Press Run YOLO inference, inspect the boxes, then raise the and run it again. Images stay in your browser. The first run downloads the model and runtime; Stop cancels the worker.
For live detection, choose Detect live from webcam and allow camera access. It works with a built-in or USB webcam. Frames stay in your browser, and changing the confidence threshold applies to subsequent frames. Stop webcam releases the camera and returns to your image.
The deployment walkthrough below uses wendy run to build and deploy YOLO11n, then download annotated images and JSON reports from the target. It uses the target's CPU. You do not need a camera or GPU for either exercise. In Write Python, await detect(threshold) runs the same browser detector on the selected image. Edit the threshold or label filter, then run the code to change the boxes and table. The image selection carries across tabs.
Once saved-image inference works, use the camera deployment workflow to test live frames and measure the added capture and transport delay.
Prepare the Wendy project
Install the Wendy CLI, start Docker, and prepare a device, a Linux computer with the Wendy Agent, or a Wendy VM. If this is your first deployment, complete discover and deploy first.
Download the edge inference starter project, extract it, and open a terminal in its edge-inference directory. The project includes a Dockerfile, wendy.json, detect.py, and a runner that serves the results. Python and model dependencies are installed inside the image.
Copy your photograph to inputs/scene.jpg. Choose an ordinary scene containing a person, chair, or cup. The first build downloads packages and model weights, so build while online.
wendy discover
wendy project validateInspect and run the detector
The starter's detect.py runs the same photograph at two confidence thresholds. The runner copies your input and the bundled model into a fresh results directory before executing it:
import hashlib
import json
from pathlib import Path
from ultralytics import YOLO
image = Path("scene.jpg")
if not image.is_file():
raise SystemExit("Add inputs/scene.jpg to the project, then run wendy run again")
model = YOLO("yolo11n.pt")
print("Supported classes:", model.names)
for threshold in (0.25, 0.6):
result = model.predict(str(image), conf=threshold, device="cpu")[0]
rows = []
for box in result.boxes:
rows.append({
"label": result.names[int(box.cls.item())],
"confidence": float(box.conf.item()),
"xyxy": box.xyxy[0].tolist(),
})
stem = f"detections-{threshold}"
result.save(filename=f"{stem}.jpg")
Path(f"{stem}.json").write_text(json.dumps(rows, indent=2))
print(f"{stem}: {len(rows)} detections")
for artifact in (image, Path("yolo11n.pt")):
print(artifact.name, hashlib.sha256(artifact.read_bytes()).hexdigest())Run it from the exercise directory:
wendy runSelect your prepared target when prompted. Wendy builds the image, deploys the app, and streams its logs. Wait for Exercise complete, then open the app URL printed by Wendy. On a LAN, it is http://DEVICE_ADDRESS:8081; for a VM, use the forwarded URL from the CLI.
Check the expected results
Download detections-0.25.jpg and detections-0.6.jpg from the results page. Each has a matching JSON file. A row contains the predicted label, confidence score, and box coordinates in the order left, top, right, bottom, measured in image pixels. Keep run.log and requirements-resolved.txt with your results.
An empty JSON array means no accepted detections. Check which boxes disappear at the higher threshold. Raising it can remove false alarms and correct detections; the remaining labels are not certain. Compare each box with the photograph and note one mistake.
Download results before redeploying; they live in the container. Stop the attached run with Ctrl+C, edit detect.py or replace inputs/scene.jpg, then run wendy run again against the same target. The results page has no authentication, so use a trusted workshop network and a photograph you can share there.
Troubleshooting
For the browser exercise, use a current browser with WebAssembly support and a JPEG, PNG or WebP under 10 MB, no more than 8192 pixels on either side. If the download fails, check your connection and run it again. The browser runs the ONNX export on the CPU; its resizing can produce slightly different boxes and scores from the Python pipeline.
If the build fails, check Docker and the first package or weight-download error. If the app exits, inspect the Wendy logs and confirm inputs/scene.jpg exists. If the results page does not open, check the selected device and that port 8081 is free. If there are no detections, try a clear photograph of a class printed in model.names.
You are done when you can match a JSON row to an image box and describe one error or threshold tradeoff. A box gives an image location, not distance or a robot destination.
Optional extension: use the detector evaluation lesson to compare results across multiple images. The Ultralytics prediction reference documents the result fields used here.
Before you move on
Can you do each of these?
- Deploy image inference with wendy run
- Inspect boxes and confidence
- Recognize vocabulary limits
0 of 3 checkpoints solved. Try checkpoint 1