vigilar/scripts/download_model.sh
Aaron D. Lee 8314a61815 Add presence detection, person/vehicle AI detection, health monitoring
Task 1 — Presence: ping family phones, derive household state
(EMPTY/KIDS_HOME/ADULTS_HOME/ALL_HOME), configurable departure delay,
per-member roles, auto-arm actions via MQTT.

Task 2 — Detection: MobileNet-SSD v2 via OpenCV DNN for person/vehicle
classification. Vehicle color/size fingerprinting for known car matching.
Zone-based filtering per camera. Model download script.

Task 3 — Health: periodic disk/MQTT/subsystem checks, auto-prune oldest
non-starred recordings on disk pressure, daily digest builder.

126 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:06:45 -04:00

24 lines
851 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
MODEL_DIR="${1:-/var/vigilar/models}"
mkdir -p "$MODEL_DIR"
PB_URL="https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/ssd_mobilenet_v2_coco_2018_03_29.pb"
PBTXT_URL="https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/ssd_mobilenet_v2_coco_2018_03_29.pbtxt"
echo "Downloading MobileNet-SSD v2 model..."
if command -v curl &>/dev/null; then
curl -fSL -o "$MODEL_DIR/mobilenet_ssd_v2.pb" "$PB_URL"
curl -fSL -o "$MODEL_DIR/mobilenet_ssd_v2.pbtxt" "$PBTXT_URL"
elif command -v wget &>/dev/null; then
wget -q -O "$MODEL_DIR/mobilenet_ssd_v2.pb" "$PB_URL"
wget -q -O "$MODEL_DIR/mobilenet_ssd_v2.pbtxt" "$PBTXT_URL"
else
echo "ERROR: curl or wget required"
exit 1
fi
echo "Model downloaded to $MODEL_DIR"
ls -lh "$MODEL_DIR"/mobilenet_ssd_v2.*