If you use software from the ZoneMinder organization please consider sponsoring ZoneMinder. ZoneMinder has been free with a paid support option and paid bounties but, it has come to the communities attention that the main/only dev of ZM needs help with bringing cash flow in. If you have the means, please consider sponsoring ZoneMinder, Thanks!
Try the x86_64 GPU/TPU accelerated Server docker image! docker.io/baudneo/zm_ml:server-full
This software is currently in alpha stage, expect issues. That said, it is fairly fast. YMMV.
This is a project aiming to update how ZoneMinder Object Detection works. A server and client are supplied to allow for easy integration with ZoneMinder.
All the server does is run ML models on supplied images and return its results.
The client is an asynchronous (mostly) script installed on the ZoneMinder machine, which grabs and sends images to a ZM ML server for inference and then processes the results to annotate images, create animations and send notifications, if configured to do so.
- @pliablepixels for zmNinja, zmeventnotification, mlapi and PyZM.
- @connortechnology for their work on ZoneMinder
-> This project is based on the work of @pliablepixels. <-
- ZoneMinder 1.37.5+ (EventStartCommand is REQUIRED)
- debian based distros can build a .deb package for the 1.37 dev branch
- Python 3.8+ (3.9 recommended) [3.10+ DOES NOT SUPPORT TPU ATM]
- Python packages required by the install script
psutil
request
tqdm
distro
- OpenCV (Contrib) 4.2.0+ (4.7.0+ recommended) with Python3 bindings.
- OpenCV is not installed by default due to possible GPU acceleration by user compiled OpenCV.
- EventStartCommand/EventEndCommand is what runs the object detection script. Before, SHM was polled every <X> seconds to see if a new event had been triggered.
The client does not have a docker image.
See the Wiki Docker page for pre requisites, tags and instructions.
See the Wiki for Manual Installation instructions.
See the Wiki for Bootstrap instructions.
- Based on FastAPI (With all the Pydantic goodness!)
- OpenCV DNN for CPU/GPU
- OpenALPR local binary supported (Must compile OpenALPR with CUDA for GPU support)
- Cloud ALPR integrations. [See notes]
- pycoral (tflite) for TPU support.
- DLib based face-recognition (GPU Recommended)
- Run locally on ZoneMinder machine or deploy to a remote machine.
- Docker images! Docker Hub
- AMD GPU's (ROCm) are NOT supported, blame AMD.
- Intel ARC/iGPU's are CURRENTLY NOT supported. (this may change as I am working on OpenVINO support)
- NVidia GPUs are supported. (CUDA)
- GPU must be Compute Capability 5.3+
- See here for a list of GPUs and their Compute Capability
- Coral.ai Google edgeTPU Accelerator (USB is confirmed, M.2/PCIe needs testing)
- CPU
See the Wiki Manual Installation Server GPU page for pre requisites and instructions.
See the Wiki Manual Installation Server TPU page for pre requisites and instructions.
- pycoral recently released wheels for Python3.10 See here
- NOTE: It is recommended to use python 3.8 or 3.9 if you want to use TPU acceleration.
The client uses the new ZoneMinder EventStartCommand/EventEndCommand option. This means ZM kicks off the ML chain instead of the ML chain scanning SHM looking for an event, more efficient!
The client grabs images, sends the images to mlapi servers, filters detected responses, post processes images and sends notifications. All the heavy computation of ML models is done by the server!
- Client MUST be installed on same host as ZM server. Multi-server ZM installs (untested) will require a client install on each server.
- OpenCV is REQUIRED for image processing, you can use
opencv-contrib-python
if you do not need GPU acceleration. libgeos-dev
: system package (used for the Shapely python module; Polygons)gifsicle
: system package (used to optimize GIFs; makes file size much smaller)
The websocket server is a legacy supporting server for zmNinja. Its sole purpose is to obtain tokens to send push notifications to zmNinja clients (Android/iOS) and retain some legacy functions in zmNinja.
Check back later for a list of environment variables and their explanation.