Stop Sign Project
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
before_hooks
extensions
handlers
helpers
lib
models
public
views
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
analyze_video.py
capture_video.py
config.ru
environment.rb
predict.py
predictor.py
presence.pkl
push_to_imgur.py
push_to_imgur_tmp.py
twitter_token.rds

README.md

Stop Sign Project

A website and rake task meant to run on a Raspberry Pi to automatically detect movement within a fixed frame via a webcam, and a lightweight way to scan through records of movement in order to train a machine learner in order to get people to get off my lawn.

To run:

  • sudo mongod --dbpath=/path/to/db
  • rake record_data
  • rvmsudo rackup -p 80 -o 0.0.0.0
  • rake analyze_data
  • rake summarize_data

Personally, my Pi has these in a script that fires on startup - for some reason, my webcam will fail to take pictures from time to time, so I just have it reboot and have this startup tmux script in ~/tmux_start.sh:

#!/bin/bash
sleep 60
SESSIONNAME="stop_sign"
cd /media/pi/STICK/stop_sign_project
tmux new-session -d
tmux neww
tmux neww
tmux neww
tmux neww
tmux send-keys -t "1" C-z 'sudo mongod --dbpath=/media/pi/STICK/data' Enter
tmux send-keys -t "2" C-z 'rvmsudo rackup -p 80 -o 0.0.0.0' Enter
tmux send-keys -t "3" C-z 'rake record_data' Enter
tmux send-keys -t "4" C-z 'rake analyze_data' Enter
tmux send-keys -t "4" C-z 'rake summarize_data' Enter

This is fired off in /etc/rc.local by adding the following line: sudo -u pi bash /home/pi/tmux_start.sh &

Installation

In order to make this project work on your Raspberry Pi without any issues, you need to 1. install the OS from the base install on Raspberry Pi's site and 2. Follow these steps to install the right CV libraries. You could probably get away doing (2) without (1), but I wasn't able to, with whatever default OS I had on my Pi when I bought it.