An overengineered reboot of the old ThinkGeek C.H.I.M.P. monitor mirror.
AKA How to make a desktop device that provides alerts you when human(s) are detected on a live-stream by a server that is performing computer vision analysis.
It uses a Raspberry Pi 5, with a camera and a Raspberry Pi AI kit as the server, and a Pico W as the client. Alerts are sent to the Pico using websockets and alerts are made by lighting an LED and showing model confidence for detection of 'person' using an analogue needle that registers on a scale of 0-1.
Here's an overview video of the build and a demo of it in action:
Connect the M2 expansion board from the AI kit to the Pi 5, connect the 22 pin ribbon cable from the CAM/DISP 0 port on the Pi.
Copy this repository to the Pi 5 using the commands
cd ~
git clone https://github.com/veebch/peeperpam.git
Then copy the file main.py
to the pico using Ampy (or Thonny)
You do that on a virtual environment which you activate with
python3 -m venv ~/.venv
source ~/.venv/bin/activate
cd ~/peeperpam
python3 server.py
./camera_monitor.sh
Now plug in the device to power, any time the camera registers a person the Red Led will light up and the needle/light level will give an approximation of the probability (1 == certainty)
The MOSFET may be overkill for the LED and Voltmeter, but if you plan to use something that draws more current than an LED, then using SYSBUS means the 'alarm' peripheral can draw a lot more current than just a GPIO pin set to high (~16mA).