Skip to main content

What

pyzmNg is a rewrite of pyzm.

It's a pythonic wrapper that integrates with ZM and also operates as a standalone ML library. Key features:

  • ZM API
  • ZM EventServerNg
  • ZM Logger
  • ZM Memory
  • Machine Learning Modules (with our without ZM)

Installation

See the installation guide on ReadTheDocs.

Documentation & Examples

Latest documentation is available here. The documentation includes a full example.

Features

  • API auth using tokens or legacy (manages refresh logins automatically)
  • Monitors
  • Events with filters
  • States
  • Configs
  • EventNotification callbacks
  • Mapped Memory access
  • Direct access to ML algorithms
  • Remote ML detection server (pyzm.serve) — run models on a GPU box, detect from anywhere
  • Amazon Rekognition support for object detection

Training UI

pyzm includes a Streamlit-based UI for fine-tuning YOLO models on your own data:

/opt/zoneminder/venv/bin/python -m streamlit run pyzm/train/app.py -- --base-path /var/lib/zmeventnotification/models

The --base-path flag points to your ZoneMinder models directory (defaults to /var/lib/zmeventnotification/models). Projects are stored in ~/.pyzm/training/.

Testing

pyzm has three test tiers:

Unit / integration tests (no hardware required):

pip install pytest
python -m pytest tests/ -m "not e2e and not zm_e2e" -v

ML end-to-end tests (require real ML models on disk):

# Requires models in /var/lib/zmeventnotification/models/
# and the test image at tests/test_ml_e2e/bird.jpg (included in repo)
python -m pytest tests/test_ml_e2e/ -v

# Skip the slower remote-serve tests:
python -m pytest tests/test_ml_e2e/ -v -m "not serve"

ZoneMinder end-to-end tests (require a live ZM server):

One-time setup:

sudo /opt/zoneminder/venv/bin/pip install pytest
cp tests/.env.zm_e2e.sample .env.zm_e2e   # edit with your ZM server details
# Readonly tests (auth, monitors, events, zones, frames, detection):
sudo -u www-data /opt/zoneminder/venv/bin/python -m pytest tests/test_zm_e2e/ -v -p no:cacheprovider

# Include write tests (event notes, stop/start/restart, DB tagging):
sudo -u www-data ZM_E2E_WRITE=1 /opt/zoneminder/venv/bin/python -m pytest tests/test_zm_e2e/ -v -p no:cacheprovider

ZM E2E tests auto-skip when .env.zm_e2e is missing, so pytest tests/ is always safe.

Developer Notes (for myself)

To make a release:

./scripts/make_release.sh

To skip PyPI upload (e.g. package already published):

./scripts/make_release.sh --skip-pypi

To test docs:

cd docs/
make html && python -m http.server -d _build/html

To test a CHANGELOG:

# __version__ in pyzm/__init__.py should be updated
# replace v2.0.3 with whatever future version
GITHUB_TOKEN=$(gh auth token) git-cliff --tag "v2.0.3"

Limitations

  • Requires Python 3.10+

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzm-2.5.1.tar.gz (505.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzm-2.5.1-py3-none-any.whl (415.7 kB view details)

Uploaded Python 3

File details

Details for the file pyzm-2.5.1.tar.gz.

File metadata

  • Download URL: pyzm-2.5.1.tar.gz
  • Upload date:
  • Size: 505.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyzm-2.5.1.tar.gz
Algorithm Hash digest
SHA256 68c64ab69a4ff7051af0678f761827e441cd5d208ff48b81481f54c2f3b5f24d
MD5 921a534fd6999762406432f0d31d218a
BLAKE2b-256 46a850b30db44cfd7865ef8869538098a03e38d1cd5df15e3adf17af5af0e2e2

See more details on using hashes here.

File details

Details for the file pyzm-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: pyzm-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 415.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyzm-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 666aebbfc997445c3f5dc9f2d6fd246da650cc6d3129e2fab64d3e48c600ac62
MD5 18397418965daf80950934a2e700a444
BLAKE2b-256 f749e2af752ee7df9f8f6b34844f7df265c65e70de75df819930ffeb72052aef

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 files

2.5.0

2 files

2.4.0

2 files

2.3.8

2 files

2.3.7

2 files

2.3.6

2 files

2.3.5

2 files

2.3.4

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.9

2 files

2.1.8

2 files

2.1.7

2 files

2.1.6

2 files

2.1.5

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

0.3.67

1 file

0.3.66

1 file

0.3.65

1 file

0.3.64

1 file

0.3.63

1 file

0.3.62

1 file

0.3.61

1 file

0.3.60

1 file

0.3.59

1 file

0.3.58

1 file

0.3.57

1 file

0.3.56

1 file

0.3.55

1 file

0.3.54

1 file

0.3.53

1 file

0.3.52

1 file

0.3.51

1 file

0.3.50

1 file

0.3.49

1 file

0.3.48

1 file

0.3.47

1 file

0.3.46

1 file

0.3.45

1 file

0.3.43

1 file

0.3.42

1 file

0.3.41

1 file

0.3.40

1 file

0.3.38

1 file

0.3.37

1 file

0.3.36

1 file

0.3.35

1 file

0.3.34

1 file

0.3.32

1 file

0.3.31

1 file

0.3.30

1 file

0.3.29

1 file

0.3.28

1 file

0.3.27

1 file

0.3.26

1 file

0.3.25

1 file

0.3.24

1 file

0.3.22

1 file

0.3.21

1 file

0.3.20

1 file

0.3.19

1 file

0.3.18

1 file

0.3.17

1 file

0.3.16

1 file

0.3.15

1 file

0.3.14

1 file

0.3.13

1 file

0.3.12

1 file

0.3.11

1 file

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.7

1 file

0.3.6

1 file

0.3.5

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.1.30

1 file

0.1.29

1 file

0.1.28

1 file

0.1.27

1 file

0.1.26

1 file

0.1.24

1 file

0.1.23

1 file

0.1.22

1 file

0.1.21

1 file

0.1.20

1 file

0.1.19

1 file

0.1.18

1 file

0.1.17

1 file

0.1.16

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page