This repository is a demonstration and proof-of-concept for an AI assistants providing improved situational awareness from a collection of network accessible video cameras. Most consumer-grade Web cameras -- or similar devices -- send notifications when motion occurs.
Motion is often defined as a change in the video from one instance to the next; these changes are often influenced by light, wind, and many other environmental factors -- producing a large number of notifications. While limitations may be set on the amount of change, a better solution would detect and classify movement.
To accomplish that objective, a combination of open source components have been integrated to provide a means to detect motion and recognize selected entities, e.g. a person, a vehicle, or an animal. The resulting detection may then be processed for notifications as well as analysis.
All of this processing is performed on local devices; there are no cloud services utilized. This pattern is known as edge computing.
Home Assistant is an open source home automation software putting local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. HomeAssistant includes add-on Docker containers from the HomeAssistant community. Please refer to the installation instructions for Home Assistant in HASSIO.md
.
The Home Assistant add-on motion
provides the capabilities of the Motion Project software in conjunction with a specified message broker to capture and process motion detection events. These events are published as MQTT
topics for consumption by Home Assistant and the supporting Open Horizon yolo4motion
service.
Please refer to MOTION.md
for further information.
In addition, the following community add-ons should be configured appropriately:
MQTT
- may be run privately on local device or shared on networkFTP
- optional, only required forftpd
type cameras
Open Horizon is an open source edge fabric for microservices. The Open Horizon microservices are run as Docker containers on a distributed network across a wide range of computing devices; from Power9 servers to RaspberryPi Zero W micro-computers.
The Open Horizon service yolo4motion
provides the capabilities of the YOLO software in conjunction with a specified MQTT
message broker. This service subscribes to the topic {group}/{device}/{camera}/event/end
and processes the JavaScript Object Notation (JSON) payload which includes a selected JPEG
image (n.b. BASE64
encoded) from the motion event. This service may be used independently of the Open Horizon service as a stand-alone Docker container; see yolo4motion.sh
The Open Horizon service alpr4motion
provides the capabilities of the OpenALPR software in conjunction with a specified MQTT
message broker. This service subscribes to the topic {group}/{device}/{camera}/event/end
and processes the JavaScript Object Notation (JSON) payload which includes a selected JPEG
image (n.b. BASE64
encoded) from the motion event. This service may be used independently of the Open Horizon service as a stand-alone Docker container; see alpr4motion.sh
The Open Horizon service face4motion
provides the capabilities of the OpenFACE software in conjunction with a specified MQTT
message broker. This service subscribes to the topic {group}/{device}/{camera}/event/end
and processes the JavaScript Object Notation (JSON) payload which includes a selected JPEG
image (n.b. BASE64
encoded) from the motion event. This service may be used independently of the Open Horizon service as a stand-alone Docker container; see face4motion.sh
When combined together and operating successfully, the system automatically detects person
and provides both visual update of the Web user-interface for the most recent entity, as well as most recent detection of any entity, as well as provides notifications through the Web interface (n.b. mobile notifications require SSL and are pending).
Data may be saved locally and processed to produce historical graphs as well as exported for analysis using other tools, e.g. time-series database InfluxDB and analysis front-end Grafana. Data may also be processed using Jupyter notebooks.
The edge of the network is where connectivity is lost and privacy is challenged; extending the services developed for the cloud to these scenarios requires additional considerations for microservices development, notably graceful degradation when services are lost, as well as automated recovery and restart when appropriate. Available computing in edge scenarios may vary from a single device to multiple varying devices on a local-area-network (LAN), for example home automation. Example use-cases include detecting motion and classifying entities seen and monitoring Internet connectivity.
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
David C Martin ([email protected])