All Projects → chollinger93 → scarecrow

chollinger93 / scarecrow

Licence: GPL-3.0 license
A Raspberry Pi powered, distributed (edge) computing camera setups that runs a Tensorflow object detection model to determine whether a person is on the camera. A plugin model allows actions based on the detection, such as playing audio, turning on lights, or triggering an Arduino.

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to scarecrow

Spocon
SpoCon - A Spotify Connect Client for Debian , Ubuntu and Raspberry Pi based on librespot-java
Stars: ✭ 51 (-41.38%)
Mutual labels:  debian, raspbian
Nginx Ee
Automated Nginx compilation from sources with additional modules support. Compatible with WordOps, EasyEngine & Plesk
Stars: ✭ 132 (+51.72%)
Mutual labels:  debian, raspbian
Hardware
The devices I have, what runs on them, their configurations, issues, solutions, and associated projects
Stars: ✭ 67 (-22.99%)
Mutual labels:  debian, raspbian
Tensorflow Bin
Prebuilt binary with Tensorflow Lite enabled (native build). For RaspberryPi / Jetson Nano. And, solved Tensorflow issues #15062,#21574,#21855,#23082,#25120,#25748,#29617,#29704,#30359. Support for custom operations in MediaPipe.
Stars: ✭ 349 (+301.15%)
Mutual labels:  debian, raspbian
Rpi Pxe Server
setup a Raspberry Pi as an PXE-Server
Stars: ✭ 197 (+126.44%)
Mutual labels:  debian, raspberry
Buildswiftonarm
All you need to build Swift on a RaspberryPi or other ARM boards, updated to Swift 5.1.5
Stars: ✭ 448 (+414.94%)
Mutual labels:  debian, raspbian
Pihole Panel
Python/GTK3 based Pi-hole (network-level adblocker) dashboard for stats and more
Stars: ✭ 125 (+43.68%)
Mutual labels:  debian, raspbian
cam-track
Windows, Unix, Raspberry Pi Computer python program to Track Camera X, Y Movements and Convert to Camera Pointing Position. Useful for Stabilization or Robotics Course Correction
Stars: ✭ 27 (-68.97%)
Mutual labels:  debian, opencv-python
Raspberrypi Ua Netinst
RaspberryPi (minimal) unattended netinstaller
Stars: ✭ 179 (+105.75%)
Mutual labels:  debian, raspbian
Tmoe Linux
🍭Without any basic knowledge of linux shell,you can easily install and configure a GNU/Linux graphical desktop environment on 📱Android termux and 💻WSL .🍰You can also run VSCode on your android phone.🍹Graphical qemu manager,🐋support running docker on Android.配置WSL和安卓手机的linux容器,桌面环境,主题美化,远程桌面,音频服务,镜像源,uefi开机启动项,webdav(nginx),fcitx输入法以及qemu-system虚拟机...
Stars: ✭ 149 (+71.26%)
Mutual labels:  debian, raspbian
Slickstack
SlickStack is a free LEMP stack automation script written in Bash designed to enhance and simplify WordPress provisioning, performance, and security.
Stars: ✭ 311 (+257.47%)
Mutual labels:  debian, raspbian
Bazel bin
Bazel's pre-built binaries for armv7l / aarch64 / x86_64.
Stars: ✭ 23 (-73.56%)
Mutual labels:  debian, raspbian
Rpi23 Gen Image
Advanced Debian "stretch" and "buster" bootstrap script for RPi 0/1/2/3 and QEMU
Stars: ✭ 300 (+244.83%)
Mutual labels:  debian, raspberry
Atomic Toolkit
AtoMiC Toolkit simplifies HTPC / Home Server setup and management on Ubuntu and Debian variants including Raspbian. It currently supports: Couchpotato, Deluged, Emby, FFmpeg, Headphones, Htpcmanager, Jackett, Kodi, Lazylibrarian, Madsonic, Mono, Mylar, Nzbget, Nzbhydra, NzbToMedia, Ombi, Plex, Plexpy, Pyload, qBittorrent, Radarr, Sabnzbd+, Sickgear, Sickrage, Sonarr, Subsonic, Transmission, Unrar, Watcher, and Webmin.
Stars: ✭ 747 (+758.62%)
Mutual labels:  debian, raspbian
airgeddon deb packages
Useful related to airgeddon packages for Debian based Linux distributions
Stars: ✭ 22 (-74.71%)
Mutual labels:  debian, raspbian
Dockstarter
DockSTARTer helps you get started with home server apps running in Docker.
Stars: ✭ 1,265 (+1354.02%)
Mutual labels:  debian, raspbian
anon-hotspot
On demand Debian Linux (Tor) Hotspot setup tool
Stars: ✭ 34 (-60.92%)
Mutual labels:  debian, raspbian
dist-detect
Try to determine what Linux/Unix distribution is running on a remote host and get a hint if security updates are applied.
Stars: ✭ 14 (-83.91%)
Mutual labels:  debian, raspbian
Pieman
Script for creating custom OS images for single-board computers
Stars: ✭ 149 (+71.26%)
Mutual labels:  debian, raspbian
raspbian10-buster
Raspbian 10 (Buster) Lite Setup: with Wireguard, Pi-hole, Unbound
Stars: ✭ 54 (-37.93%)
Mutual labels:  debian, raspbian

Scarecrow-Cam

pytest covearge

Maintenance & Project Status

https://img.shields.io/badge/Limited%20Maintenance%20Intended-x-important

This project is in what I would describe as "Limited maintenance only" status. I'll continue to listen to CVE notifications and make sure you have some way of running it, but I don't intend on working on any major releases.

This project, at the time of writing, was a fun idea that used a somewhat novel approach to solve a real-life problem - a showcase, not a real, long-term project. But like so many tech showcases, that's all it is: Designed well enough to work and make a point, but not important enough to keep updated.

Since writing this in 2019, things have moved on: This project depends on a very specific, old, and hence not necessarily well-performing Tensorflow model and was never designed to be containerized from the ground up, which makes the build and deployment process exceptionally brittle and, frankly, tedious to maintain. About half the dependencies called out in the INSTALL.md file are probably not actually needed.

There are also some (given the nature of a showcase, somewhat intentional) design oversights that could be mitigated, namely the weak abstraction at many points of the project, such as in the plugin model; while re-working those is certainly possible, it's not something I'll be spending any time on soon.

Last but not least, there simply are better ways of deploying an object detection model on a Raspberry these days, such as TensorFlow Lite that allow you to run a model directly on the Pi. Local detection can still react accordingly to a detection threshold (which could be centrally managed, e.g. in a database) in the same way it does here, or even directly via GPIO. Nothing stops you from still maintaining a central point of accessing alerts from multiple cameras, but running the model locally will always outperform a network video stream.

Introduction

A Raspberry Pi powered, distributed (edge) computing camera setups that runs a Tensorflow object detection model to determine whether a person is on the camera. The Raspberry Pi is used for video streaming and triggering actions (such as playing audio, turning on lights, or triggering an Arduino), whereas a server or laptop runs the object detection. With a suitable TFLite installation, this can happen locally on the Raspberry as well.

Based on the detection criteria, a plugin model allows to trigger downstream actions.

Based on my blog.

Architecture

Architecture

Sample

Side note: The setup shown here only fits the use-case of edge to a degree, as we run local detection on a separate machine; technically, the Raspberry Pi is capable of running Tensorflow on board, e.g. through TFLite or esp32cam.

You can change this behavior by relying on a local tensorflor instance and having the ZMQ communication run over localhost.

Updates

Please see CHANGELOG.md for details.

Configuration and data

Copy config/config.ini.sample to conf/config.ini with the settings for your Raspberry and server.

For playing audio, please adjust conf/plugins.d/audio.ini.

[Audio]
Path=../audio_files

For an appropriate path.

If you want to change the model, please check the Model Zoo. The blog article used the outdated ssd_mobilenet_v1_coco_2017_11_17.

[Tensorflow]
ModelUrl=ssd_mobilenet_v3_large_coco_2019_08_14
LabelMapPath=./models/research/object_detection/data/mscoco_label_map.pbtxt

Installing

Requirements

This project requires:

  • A Raspberry Pi + the camera module v2 (the client)
  • Any Linux machine on the same network (the server)

Pi

Using Docker (recommended)

Docker

Using Docker is the preferred way of running scarecrow, as it handles dependencies internally and operates within a controllable environment.

Build Image

git submodule update --init --recursive && git submodule update --remote
docker build . -t scarecrow

Run separately

Both client and server containers should be ran separately.

Server

This runs tensorflow and opens the zmq listener.

docker run -it \
    --name scarecrow_server \
    -p 5455:5454 \
    --ipc=host \
    -v $(pwd)/conf:/config \
    -v $(pwd)/models/research/object_detection/data:/models \
    scarecrow \
    /usr/local/bin/scarecrow_server --config /config

Client

Check cameras in /dev with ffplay /dev/video$x

docker run -it \
    --name scarecrow_client \
    -p 5454:5454 \
    -p 5558:5558 \
    --ipc=host \
    -v $(pwd)/conf:/config \
    -v $(pwd)/resources/audio_files:/data \
    --device /dev/snd:/dev/snd \
    --device=/dev/video2:/dev/video0 \
    scarecrow \
    /usr/local/bin/scarecrow_client --config /config --input 0

Docker Compose

Experimental

docker-compose up

Manual install (advanced)

scarecrow-cam can be installed using pip:

pip3 install . --upgrade

Please see INSTALL.md for details and troubleshooting.

Run (RasPi)

scarecrow_client --config ./conf --input 0 # for picam
scarecrow_client --config ./conf --input ./resources/tests/walking_test_5s.mp4 # for local video 

Run (Server)

scarecrow_server --config ./conf

Plugins

A plugin model allows to trigger downstream actions. These actions are triggered based on the configuration.

Plugins can be enabled by setting the following in config.ini:

[Plugins]
Enabled=audio
Disabled=

Currently, the following plugins are avaibale:

Plugin Description Requirements Configuration Base
audio Plays audio files once a person is detected Either playsound, pygame, or omxplayer conf/plugins.d/audio.ini ZMQ
store_video Stores video files on the server, with a defined buffer or length Path and Encoding settings conf/plugins.d/store_video.ini ZServerMQ

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].