Raspberry-pi based camera that lets you segment and object track photo & video objects.
- Flash sd card with nixos sd image
- Download latest image
- the one I used: nixos-sd-image-24.05.5596.d51c28603def-aarch64-linux.img
- if its a
.zst, decompressunzstd <img-name>.img.zst
- flash the sd card
sudo dd if=<nixos img> of=<sd card path>
- find the sd card path with
lsblk(or watchdmesgas you plug it in)
- find the sd card path with
- Download latest image
- Boot raspberry pi with the sd card
- Connect to internet: (as root)
wpa_supplicant -B -i wlan0 -c <(wpa_passphrase 'SSID' 'password') &- just replace the SSID and password, don't omit the
&or other symbols - when the command finishes check you're online with
host nixos.orgorping 8.8.8.8 - if you typo,
pkill wpa_supplicantand try again
- [Optional] update raspberry pi firmware
nix-shell -p raspberrypi-eeprom mount /dev/disk/by-label/FIRMWARE /mnt BOOTFS=/mnt FIRMWARE_RELEASE_STATUS=stable rpi-eeprom-update -d -a
- [Probably unnessesary] Generate default configs
nixos-generate-config- Add nixos hardware channel
sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware sudo nix-channel --update
- Clone the repo
nix-shell -p git --run "git clone https://github.com/e-cal/segcam.git"- Install
cd segcam/system && ./install- Rebuild nixos
sudo nixos-rebuild boot- Reboot
- default user is
segcamwith passwordsegcam - will need to re-setup network connection using
networkmanager- list networks:
nmcli dev wifi - connect:
nmcli dev wifi con 'SSID' --ask
- list networks:
- default user is
cd segcam, do everything from this dir- Install sam2
git clone https://github.com/facebookresearch/sam2.git
mkdir tmp && TMPDIR="tmp" pip install -e sam2; rmdir tmp- Get model weights:
./checkpoints/download_ckpts.sh- Install dependencies
pip install -r requirements.txt- Run app
python app/main.py- make hyprland auto run and fullscreen app after setup
- auto setup/build script (nix build system?? ref phobos)
- [-] make the app good