You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.3 KiB

PTZ Tracker — Modular Version

Structure

ptz_tracker_modular/
├── app.py                # entrypoint (async main)
├── calibration.py        # preset/sector and pan-sign calibration
├── config.py             # constants + camera config
├── events.py             # alarms, detection event plumbing
├── geom.py               # angular math and sector helpers
├── heartbeat.py          # UDP heartbeat
├── model.py              # YOLO loading + forward
├── patrol.py             # patrol logic (bounded/smooth + sync)
├── postprocess.py        # PTZ control + zoom + notify_detected
├── preview.py            # JPEG encode and preview publishing
├── ptz_io.py             # PTZ HTTP session + worker + bounded move
├── sector.py             # sector init and autocalculation
├── state.py              # runtime shared state
├── status.py             # PTZ status poller
├── streaming.py          # WS servers, MicroBatcher, CPP bridges
└── __init__.py

Run

python -m ptz_tracker_modular.app

Optional env:

  • YOLO_WEIGHTS=/path/to/weights.pt
  • CAM_<ID>_PASSWORD=... for every camera id

Dependencies: opencv-python, torch, ultralytics, websockets, requests, numpy.