Raspberry Pi 5 Person Detection with Frigate: Boss Detector
Boss Detector is a Raspberry Pi person detection recipe: Frigate NVR finds people, and a Python listener acts on Frigate's MQTT messages. A ready-compiled YOLOv8n model runs on the DEEPX DX-M1M NPU of a Sixfab AI HAT+ for Raspberry Pi 5, so you train nothing. The listener's action is a placeholder that publishes each alert to MQTT and logs it.
Part of the Raspberry Pi 5 AI projects series.
| Field | Value |
|---|---|
| Use case | Home security |
| Difficulty | Intermediate |
| What it does | Detects people in Frigate and runs trigger_alert() from an MQTT listener, which today publishes a JSON alert to boss_detector/alert and logs a line |
| Stack; camera input | Frigate NVR; RTSP |
| On the DEEPX NPU | Object detection: YOLOv8n (COCO-80), including person |
| On the Pi 5 CPU | Frigate's decoding, motion detection and tracking, plus the MQTT listener |
| Frigate build | ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64, built from commit af0ba19 of Frigate's dev branch (see Limitations) |
| Model | yolov8n-ppu-coco80.dxnn, 640×640 input, yolo-generic model type |
| Detector maintainer | Sixfab develops and maintains DEEPX support in Frigate (Frigate's DEEPX NPU detector docs) |
| Model license | AGPL-3.0 (Ultralytics YOLOv8n). Details in the release notes at https://github.com/sixfab/sixfab-dx-frigate/releases/tag/boss-detector-v1.0.0 |
| Alert action | Placeholder: publishes a JSON alert to boss_detector/alert and logs a line |
| Tested on | Raspberry Pi 5 (8 GB) with the Sixfab AI HAT+ (DEEPX DX-M1M), Raspberry Pi OS Trixie 64-bit, RT driver v2.6.0, PCIe driver v2.5.0, DX-RT v3.4.2 and v3.4.0, firmware v2.7.4, ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64, live IP camera over RTSP |
| Last tested | 2026-10-05 |
What you will build
You will build a Raspberry Pi person detection trigger, a "someone walked into view" signal. A camera streams video to Frigate. Frigate finds people in that video with a ready-compiled model that runs on the DEEPX NPU. Each time it confirms a person, it publishes a message on MQTT. A small Python program, the listener, reads those messages and calls a function named trigger_alert().
trigger_alert() is a placeholder function. Today it publishes one JSON alert to the boss_detector/alert MQTT topic and writes a matching BOSS DETECTED log line. You can watch the alerts with mosquitto_sub. You decide what comes next: a sound, a light, a receipt printer or a Home Assistant webhook. The detection and the alert message are the parts this project provides.
Boss Detector is the first project in the Raspberry Pi 5 AI projects series. It suits you if you want a small example of Raspberry Pi object detection with Frigate and the DEEPX NPU, with as little code as possible. You do not train a model, and you do not write detection code. You write only the action.
Two alerts arrive on boss_detector/alert, about five seconds apart, each as JSON with the camera name cam1, a score and a Unix timestamp.
What do NPU, COCO-80, MQTT and the other Boss Detector terms mean?
Each term Boss Detector uses is defined below in one sentence, so you can read the rest of the page without looking anything up. The Raspberry Pi 5 AI projects glossary covers the terms all the projects share.
| Term | Meaning |
|---|---|
| NPU | A neural processing unit, a chip that runs AI models; here it is the DEEPX DX-M1M on the Sixfab AI HAT+ |
| Ready-compiled | Already compiled into a .dxnn file, so you do not train or compile anything |
| COCO-80 | A set of 80 object classes in which person is class 0 |
| PPU | The Post-Processing Unit of the DEEPX NPU, which decodes detection boxes and applies NMS on the chip |
| Label map | A text file that ties the model's class numbers to object names, such as 0 to person |
| YOLOv8n | The nano size of the YOLOv8 object detection model family |
.dxnn | DEEPX's compiled model file format |
| RTSP | The protocol IP cameras use to stream video over a network |
| MQTT | A publish-and-subscribe messaging protocol: programs publish messages to named topics, and others subscribe to them |
| Broker | The server that receives MQTT messages and passes them to subscribers, for example Mosquitto |
| Topic | The name of an MQTT message channel, such as frigate/events |
| Tracked object | One object followed across frames, with one id and new, update and end messages |
| Confidence score | The model's certainty from 0 to 1 for one box; it is not an accuracy figure |
| User-level systemd service | A background service that runs under your own user account instead of root |
How does Boss Detector work?
Boss Detector does Frigate person detection as a chain of five steps. Frigate and the listener are separate programs, and they only talk through MQTT.
- The camera streams video over RTSP.
- Frigate's DEEPX NPU detector runs
yolov8n-ppu-coco80.dxnnon the NPU. Person is class 0 in COCO-80. - Frigate publishes tracked-object messages on the
frigate/eventsMQTT topic. notify.py, a Python listener that runs as a user-level systemd service, receives each message and callstrigger_alert()for aneworupdateperson message with a score of 0.6 or higher, at most once every 5 seconds per camera.trigger_alert()publishes a JSON alert toboss_detector/alertand writes aBOSS DETECTEDlog line. A real action replaces it later.
The model is a ready-compiled .dxnn file, and its label map lists person as class 0, so YOLO person detection needs no training from you. See the YOLOv8 documentation for the model family. Each model's license and details are in the release notes at https://github.com/sixfab/sixfab-dx-frigate/releases/tag/boss-detector-v1.0.0.
What runs on the DEEPX NPU and what runs on the Raspberry Pi 5 CPU?
In Boss Detector, the DEEPX NPU runs only the YOLOv8n object detection model. The model's post-processing, which decodes the boxes and removes duplicates with non-maximum suppression (NMS), runs on the NPU's Post-Processing Unit (PPU). Frigate's decoding, motion detection and tracking, plus the Python listener, run on the Raspberry Pi 5 CPU.
What does the Python listener do when Frigate detects a person?
Boss Detector's Python listener, notify.py, subscribes to Frigate's frigate/events MQTT topic, parses each JSON message, and keeps only person objects whose message type is new or update. It ignores messages below a score of 0.6. It then calls trigger_alert() at most once every 5 seconds for each camera, so one person who stays in view does not produce an alert for every update. The first sighting always fires immediately. The listener reads the score from top_score when the message has one, and from score otherwise. It subscribes to frigate/events with the frigate prefix written into the code, so keep Frigate's topic_prefix at its default.
Here is the listener in full. Set BROKER to your MQTT broker address. The listener connects without a username or password.
"""Boss Detector - frigate/events listener.
Listens for Frigate person events on MQTT and calls trigger_alert().
Replace the action in trigger_alert() with your own; for now it logs the alert and publishes it to MQTT.
"""
import json
import logging
import time
import paho.mqtt.client as mqtt
BROKER = "<broker-host>" # replace with your MQTT broker address
PORT = 1883
EVENTS_TOPIC = "frigate/events"
ALERT_TOPIC = "boss_detector/alert" # this script publishes here on every alert
TARGET_LABEL = "person"
MIN_SCORE = 0.6
COOLDOWN_SECONDS = 5 # prevents spam - always fires on first sighting
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s")
log = logging.getLogger("boss-detector")
_last_triggered: dict[str, float] = {}
def trigger_alert(client: mqtt.Client, camera: str, score: float) -> None:
"""Log the alert and publish it to ALERT_TOPIC as JSON.
Put your real action here.
Examples: requests.post(webhook_url, json=...), play a sound
(playsound), trigger a smart plug/light, print "BOSS INCOMING" on a
receipt printer, publish to Home Assistant via MQTT."""
log.warning("BOSS DETECTED camera=%s score=%.2f (simulated for now)", camera, score)
client.publish(
ALERT_TOPIC,
json.dumps({"camera": camera, "score": round(score, 2), "timestamp": time.time()}),
qos=1,
)
def on_connect(client: mqtt.Client, userdata, flags, rc):
if rc != 0:
log.error("MQTT connection error, rc=%s", rc)
return
log.info("Connected to broker (%s:%s), listening on %s", BROKER, PORT, EVENTS_TOPIC)
client.subscribe(EVENTS_TOPIC)
def on_message(client: mqtt.Client, userdata, msg: mqtt.MQTTMessage):
try:
payload = json.loads(msg.payload.decode())
except (json.JSONDecodeError, UnicodeDecodeError):
log.warning("Malformed payload, skipping")
return
after = payload.get("after") or {}
event_type = payload.get("type")
label = after.get("label")
if label != TARGET_LABEL:
return
# Both "new" AND "update" trigger - notified as soon as the person is
# seen (first "new" event, published ~0.4s in) and again as they move
# (each "update"). Only cooldown prevents spam, not the event type.
if event_type not in ("new", "update"):
return
camera = after.get("camera")
score = after.get("top_score") or after.get("score") or 0.0
if score < MIN_SCORE:
log.debug("Score below threshold (%.2f < %.2f), skipping", score, MIN_SCORE)
return
now = time.monotonic()
last = _last_triggered.get(camera, 0.0)
if now - last < COOLDOWN_SECONDS:
log.info(
"Person detected again but still in cooldown (%.0fs left), skipping",
COOLDOWN_SECONDS - (now - last),
)
return
_last_triggered[camera] = now
trigger_alert(client, camera, score)
def main() -> None:
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect(BROKER, PORT, keepalive=60)
client.loop_forever()
if __name__ == "__main__":
main()The alert is published to boss_detector/alert as JSON with the camera name, the score and a Unix timestamp. The log text includes "(simulated for now)" because trigger_alert() is a placeholder: no physical output is connected.
Which Frigate MQTT topic should trigger a person-detection action?
Use frigate/events, as Boss Detector does; it carries one message per changed tracked object. The table compares it with two other Frigate topics, from Frigate's MQTT topic reference. The Camera Feeds and MQTT page lists the Frigate MQTT message fields that each project listener reads.
| Topic | What Frigate sends | Fit for a per-person action |
|---|---|---|
frigate/events | One message per changed tracked object, typed new, update or end | Per tracked person |
frigate/reviews | One message per changed review item, with alert or detection severity | Per review item, which can hold several objects |
frigate/<camera-name>/person | The count of people on that camera | A count, not an event; suits sensors |
Should a Frigate person alert act on new or update events?
Act on both if you want a live signal while the person stays in view, as Boss Detector does. A new message fires only once, when Frigate first confirms a track, so the listener also acts on update messages, which Frigate sends as the person moves. The 5-second cooldown limits the repeats. Frigate's tracker confirms a new object after min_initialized frames, which defaults to half the detect fps; at 5 fps that is 2 frames.
Requirements
You need a Raspberry Pi 5, a Sixfab AI HAT+ (DEEPX DX-M1M), Frigate with the DEEPX detector, an RTSP camera and an MQTT broker.
Hardware:
| Item | What to use |
|---|---|
| Computer | Raspberry Pi 5 |
| NPU board | The Sixfab AI HAT+ (DEEPX DX-M1M), set up as described in the Sixfab AI HAT+ Quickstart |
| Camera | Any RTSP camera or stream |
Software:
| Item | What to use |
|---|---|
| Frigate | Frigate NVR with the DEEPX detector; set up Frigate with the DEEPX NPU first |
| MQTT broker | A broker on your network that accepts connections on port 1883 without a user name, password or TLS, for example Mosquitto |
| Tools | git, curl, sha256sum and python3 |
| Model files | yolov8n-ppu-coco80.dxnn, downloaded from the project's GitHub release, in the project's model folder. The label map is Frigate's built-in /labelmap/coco-80.txt |
| Listener | notify.py (above), boss-detector-automation.service (below), and the Python package paho-mqtt (version 1.x) |
Set things up in this order: the Sixfab AI HAT+ Quickstart, then Frigate NVR on Raspberry Pi 5 with the DEEPX NPU, then Camera Feeds and MQTT for Frigate Projects for the camera and the broker. The Frigate setup page holds the one full docker run command for Frigate. This page shows only the camera and model config and docker restart frigate.
Install
Install Boss Detector with the install script, or follow the manual steps.
Quick install
The Quick install sets up the model, the camera and the listener service in one run. Run this on the Raspberry Pi 5, as your normal user:
git clone https://github.com/sixfab/sixfab-dx-frigate.git
cd sixfab-dx-frigate/apps/boss-detector
./install.sh --rtsp-url <rtsp-url> --broker <broker-host>--rtsp-urlis the RTSP address of your camera.--brokeris the host of your MQTT broker.--yesrestarts the Frigate container without asking.
The installer asks for anything you leave out. The installer downloads the model file from the project's GitHub release and checks its SHA-256 before it installs it. It needs git, curl and sha256sum. The install.sh script copies the model, merges the model and one camera into your Frigate config.yaml (after saving a backup), installs the listener as a user service (the listener folder is ~/sixfab-apps/boss-detector) and offers to restart Frigate. It does not run enable-linger; it only prints the command, which is in the manual install below.
Manual install
The manual install does the same steps by hand: get the files, add the model and camera to Frigate, run the listener, and restart Frigate.
-
Clone the repository and open the project folder.
git clone https://github.com/sixfab/sixfab-dx-frigate.git <repo-dir> cd <repo-dir>/<project-path> -
Download the model from the project's GitHub release, check it, and copy it and the label map into Frigate's model cache. Use the repository address without a trailing
.gitin the download URL.curl -fL -o model/yolov8n-ppu-coco80.dxnn https://github.com/sixfab/sixfab-dx-frigate/releases/download/boss-detector-v1.0.0/yolov8n-ppu-coco80.dxnn awk '$1 !~ /^#/ && NF {print $3 " " $2}' models.txt | sha256sum -c -Expected output:
model/yolov8n-ppu-coco80.dxnn: OK. Then copy the files:mkdir -p <frigate-config-dir>/model_cache cp model/yolov8n-ppu-coco80.dxnn <frigate-config-dir>/model_cache/ -
Add the model and camera to
<frigate-config-dir>/config.yaml. Merge them into your existingmodelslist andcamerassection; do not replace your own cameras. Use your own camera name and<rtsp-url>. Keep a backup of the file first.models: - scene: indoor_thermal model_type: yolo-generic width: 640 height: 640 path: /config/model_cache/yolov8n-ppu-coco80.dxnn labelmap_path: /labelmap/coco-80.txt devices: - deepx:PCIe:0 cameras: cam1: ffmpeg: inputs: - path: <rtsp-url> roles: - detect detect: enabled: true width: 1280 height: 720 scene: indoor_thermal objects: track: - person filters: person: min_score: 0.6 threshold: 0.7 record: enabled: falsescene: indoor_thermalis only an unused slot in Frigate's fixed scene list. It ties the camera to this model, and no thermal camera is involved. If another model on your instance already usesindoor_thermal, choose another unused scene value. -
Install the listener with its own Python virtual environment.
mkdir -p ~/sixfab-apps/boss-detector cp automation/notify.py ~/sixfab-apps/boss-detector/notify.py cd ~/sixfab-apps/boss-detector python3 -m venv venv ./venv/bin/pip install "paho-mqtt<2"Edit
BROKERin~/sixfab-apps/boss-detector/notify.pyto your<broker-host>. -
Create the user service file at
~/.config/systemd/user/boss-detector-automation.service.[Unit] Description=Boss Detector - Frigate MQTT person-detection trigger listener After=network-online.target Wants=network-online.target [Service] Type=simple WorkingDirectory=%h/sixfab-apps/boss-detector ExecStart=%h/sixfab-apps/boss-detector/venv/bin/python %h/sixfab-apps/boss-detector/notify.py Restart=on-failure RestartSec=5 [Install] WantedBy=default.target -
Start the service.
systemctl --user daemon-reload systemctl --user enable --now boss-detector-automation.serviceTo start it after a reboot without logging in, run this once. It asks for your password.
sudo loginctl enable-linger $USER -
Restart Frigate so it loads the new model and camera.
docker restart frigate
Verify
Verify with four checks: the alert topic, Frigate's stats, the Frigate UI and the raw events topic. Run them in order.
-
Watch the alerts the listener publishes. Run this on any computer that can reach the broker, then walk into the camera view.
mosquitto_sub -h <broker-host> -t boss_detector/alert -vExpected: one line each time a person is detected, at most one per camera every 5 seconds, in this shape (the values are examples):
boss_detector/alert {"camera": "cam1", "score": 0.9, "timestamp": 1791267504.950264}If nothing arrives, check the service in Troubleshooting.
-
Check Frigate and the detector. Run the API check inside the container.
docker exec frigate curl -s http://localhost:5000/api/statsExpected: JSON with detector and camera statistics.
-
Open
https://<pi-ip>:8971, walk into the camera view and confirm a person box on your camera. -
Optional: watch the topic the listener reads.
mosquitto_sub -h <broker-host> -t 'frigate/events' -v
Frigate documents port 5000 as internal, unauthenticated access, and treats every request there as admin-level. Run API checks through docker exec, and browse to port 8971 only.
How fast is Frigate person detection on the DEEPX NPU?
Speed is not measured for Boss Detector, so this page lists no figures for inference time, detection frame rate, NPU or CPU load, person-to-log latency, missed people or false alerts. To measure your own setup, read the detector figures from the /api/stats output in Verify check 2, and check NPU load with dxtop.
Limitations
Boss Detector's main limits are a placeholder alert, no way to tell who a person is, no camera filter or event-ID tracking, a broker connection without credentials, and no speed measurements.
- DEEPX support was merged into Frigate's dev branch on 2026-09-21 (PR #24336). It is not in a stable release yet; the latest stable release is v0.18.0 (2026-09-12). Sixfab develops and maintains DEEPX support in Frigate (Frigate's DEEPX NPU detector docs). The
ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64image is built from commit af0ba19 of Frigate's dev branch; the setup page pulls it. - The action is a placeholder: it publishes an alert and logs a line, and nothing else happens. The listener detects a person, not who the person is, so it cannot tell your boss from anyone else.
- The listener subscribes to events from every camera on the broker. It does not filter by camera name.
- The listener de-duplicates only by time: one trigger per camera every 5 seconds. It does not track event IDs, so a person who stays in view for longer than 5 seconds triggers again, and a person who leaves and returns triggers after the cooldown.
- The listener connects to the broker on port 1883 without credentials or TLS, so it works only with a broker that allows that.
- Speed, latency and false alerts are not measured for Boss Detector.
- Boss Detector was set up with Frigate in Docker. Home Assistant OS and the Frigate add-on were not tested.
- Port 5000 has no authentication. Frigate runs with host networking, so it is already on the Pi 5's network with no Docker
-pflag to leave it unpublished; firewall it instead. - Frigate chooses the DX-RT version its DEEPX detector uses. The tested build pins DX-RT v3.4.0, and this page cannot change it.
- If the DX-RT daemon (the DEEPX runtime) restarts, restart the Frigate container too.
Privacy
A camera that watches people records personal data. Point it at your own space and tell people it is there.
- Recording at work can be regulated. Check your local rules; this page makes no compliance claim.
- Keep the "boss" idea light. Do not use it to watch coworkers in secret.
- The camera block in this project sets
record: enabled: false, so this camera does not record video. Check your ownrecordand snapshot settings, globally and per camera, because recording and snapshots can store images of people. - Frigate downloads the DX-RT Python bindings once at first start, and again when a release pins a new version, so the first start needs internet access.
- The listener talks to your MQTT broker only, which is normally on your local network. It publishes the camera name, a score and a timestamp to
boss_detector/alert, so anyone who can read that broker can see when a person appeared.
Troubleshooting
Check the listener service first, then the alert topic, then the cooldown. For Frigate and detector problems, see Troubleshooting on the Frigate setup page.
The service is not active
Read the last 30 log lines:
systemctl --user status boss-detector-automation.service --no-pager -n 30The service should be active (running) and, at startup, the log shows Connected to broker (...), listening on frigate/events. If the log shows MQTT connection error, check BROKER and PORT in notify.py, and that the broker is reachable from the Raspberry Pi 5.
No alerts on boss_detector/alert when someone walks into view
boss_detector/alert when someone walks into viewCheck in this order: the person box in the Frigate UI, the detector section of /api/stats, and the raw messages from mosquitto_sub. The listener also skips a person below a score of 0.6, and any person within 5 seconds of the last trigger on the same camera.
The service log shows only Person detected again but still in cooldown
Person detected again but still in cooldownThe listener received the person, and the 5-second cooldown suppressed the alert. This is expected while a person stays in view.
FAQ
How do I get an MQTT alert every time Frigate detects a person?
Subscribe a listener to Frigate's MQTT messages and act on each message labeled person. Boss Detector does this with notify.py, which calls trigger_alert() for person detections of score 0.6 or higher, at most once every 5 seconds per camera. Today that action publishes an alert to boss_detector/alert and writes a log line.
Does Frigate support the DEEPX NPU and the Sixfab AI HAT+?
Yes, through Frigate's DEEPX detector, which is in Frigate's dev branch and not yet in a stable release (the latest stable release is v0.18.0). Sixfab develops and maintains it, and Frigate publishes the build as ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64 on GitHub Container Registry, built from commit af0ba19 of the dev branch. This page was tested on the Sixfab AI HAT+ (DEEPX DX-M1M).
What do I need for Frigate person detection on a Raspberry Pi 5?
A Raspberry Pi 5 with the Sixfab AI HAT+ (DEEPX DX-M1M), Frigate already running with the DEEPX NPU, an RTSP camera, and an MQTT broker. The Frigate setup page and the Camera Feeds and MQTT page cover each of them.
Do I need to train a model to detect people in Frigate?
No. Boss Detector uses a ready-compiled YOLOv8n model for the DEEPX NPU, with the COCO-80 label map, where person is class 0. Training details and the license are in the release notes.
Can I build a Raspberry Pi boss detector that warns me when someone walks up behind my desk?
Partly. Boss Detector calls trigger_alert() for any person Frigate detects on an RTSP camera, and today that only publishes an alert to boss_detector/alert and writes a log line. It was tested with a porch camera stream, not a desk camera, and it cannot tell who the person is.
Can I use Frigate person detection without Home Assistant?
Yes. Boss Detector uses only Frigate, an MQTT broker and a Python listener. A Home Assistant webhook is one optional next step.
How do I stop repeated Frigate alerts for the same person?
Raise COOLDOWN_SECONDS in notify.py. The listener allows one trigger per camera in each cooldown window, which is 5 seconds by default. It does not track Frigate's event IDs, so a person who stays in view past the window triggers again.
Next steps and related projects
Start with the action: replace the placeholder, then pick a related project.
- Replace the placeholder in
trigger_alert()with a sound, a light, a receipt printer or a Home Assistant webhook. Use low-voltage devices or a certified smart plug; never switch mains power from GPIO. See Frigate's Home Assistant integration. - Zone and sequence logic: Porch Pirate: Frigate Package Detection on Raspberry Pi 5.
- Recognize who is there: Raspberry Pi Face Recognition Camera with Frigate.
- Another MQTT listener, for squirrels: Frigate Squirrel Detection on Raspberry Pi 5 with DEEPX NPU.
- A different approach on other hardware: face-based human detection with OpenCV on ALPON.
- More models for the NPU: pre-compiled .dxnn models in the Sixfab Model Zoo.
- Back to all Raspberry Pi 5 AI projects with the DEEPX NPU, the Frigate setup guide for the DEEPX NPU and RTSP camera and MQTT broker setup pages, and the Sixfab AI HAT+ product page.
License and credits
Each model file has its own license, listed with the model details in the release notes at https://github.com/sixfab/sixfab-dx-frigate/releases/tag/boss-detector-v1.0.0. The code is licensed under the MIT License.
Credits: YOLOv8n by Ultralytics (AGPL-3.0), and Frigate NVR.
Updated about 10 hours ago
