Real-Time Wireless & Multi-Camera Live Detection#
Need live detection during an experiment — or automated MP4 clip recording whenever a mouse, rat, or target object enters view? Annolid supports real-time YOLO11 / YOLO26 / YOLOE inference over USB webcams, RTSP IP cameras, RTP multicast streams, MJPEG wireless cameras, and multi-camera synchronized ZeroMQ pipelines.
Prerequisites#
Install Annolid with the yolo and realtime extras (or the workstation / full profile):
pip install "annolid[gui,yolo,realtime]"
1. Single-Camera & Wireless IP Camera Setup (GUI)#
Open the Realtime window in Annolid — the left control panel is split into two clean tabs:
Setup Tab#
Select a model: Pick a built-in YOLO preset (for example
yolo11n-seg.ptfor high FPS) or select Custom… to load your own fine-tuned.pt,.onnx,.engine, or.mlpackageweights.Enable View only (no detection or inference) if you just want to check camera framing without loading a model.
Enter your Camera / Stream source:
USB camera index:
0(or1,2)RTSP IP stream:
rtsp://camera-host:554/stream1RTP multicast:
rtp://@239.0.0.1:5004Wireless MJPEG URL:
http://camera-host/img/video.mjpeg(Annolid also auto-normalizes common camera control pages like.../img/main.cgi?...)Local video file path (for dry-run testing)
RTSP Transport: Leave on
Auto(or switch toTCPif Wi-Fi packet loss causes gray/broken frames).
Run & Output Tab#
Tune Frame Width / Height, Max FPS (for example
15FPS on wireless cameras), and Confidence threshold (0.25is a strong default).Enable Save MP4 segments on detections to record only meaningful behavioral events:
Segment Targets: comma-separated classes to trigger recording (e.g.,
mouseoranimal).Prebuffer / Postbuffer: e.g.,
2.0 sbefore first detection and3.0 safter last detection so event onset is never clipped!Min / Max Duration: prevents tiny 1-frame noise clips or runaway recordings.
Click
Start Realtimeto begin andStopto finish cleanly.
2. Multi-Camera Live Detection (CLI + ZeroMQ)#
For multi-view behavioral rigs, launch one perception worker per camera with its own camera_id, ZeroMQ publisher port, and output folder:
# Camera 0 (USB overhead camera)
python -m annolid.realtime.perception \
--camera-index 0 \
--publisher tcp://*:5555 \
--model yolo11n-seg.pt \
--targets mouse \
--save-detection-segments \
--detection-segment-output-dir runs/realtime/overhead_cam
# Camera 1 (Wireless RTSP side camera)
python -m annolid.realtime.perception \
--camera-index 'rtsp://user:pass@192.168.1.50:554/stream1' \
--publisher tcp://*:5556 \
--model yolo11n-seg.pt \
--targets mouse \
--save-detection-segments \
--detection-segment-output-dir runs/realtime/side_cam
Each camera worker publishes its camera_id in frame, detection, and status messages so downstream closed-loop scripts can subscribe over ZeroMQ independently.
Tip
Quick troubleshooting: If a wireless stream stutters, switch RTSP transport to TCP, lower resolution to 640×480 at 15 FPS, and verify the stream URL opens in VLC or a browser first. See the Wireless Camera and Multi-Camera tutorials on the Docs Portal.