Metadata-Version: 2.4
Name: yolo26-analytics
Version: 0.1.3
Summary: Real-time object tracking, zone analytics, and event alerting built on YOLO26
Project-URL: Homepage, https://github.com/MohibShaikh/yolo26-analytics
Project-URL: Repository, https://github.com/MohibShaikh/yolo26-analytics
Project-URL: Issues, https://github.com/MohibShaikh/yolo26-analytics/issues
Author: Baz
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: analytics,bytetrack,heatmap,object-detection,tracking,yolo,yolo26,zone
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.10
Requires-Dist: aiomqtt>=2.0.0
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: click>=8.1.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: opencv-python-headless>=4.8.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: shapely>=2.0.0
Requires-Dist: sqlalchemy[asyncio]>=2.0.0
Requires-Dist: sse-starlette>=1.6.0
Requires-Dist: ultralytics>=8.3.0
Requires-Dist: uvicorn[standard]>=0.27.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Requires-Dist: testcontainers[postgres]>=3.7.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
Requires-Dist: types-shapely>=2.0.0; extra == 'dev'
Provides-Extra: rfdetr
Requires-Dist: rfdetr>=1.0.0; extra == 'rfdetr'
Provides-Extra: sahi
Requires-Dist: sahi>=0.11.0; extra == 'sahi'
Provides-Extra: tensorrt
Requires-Dist: tensorrt>=8.6.0; extra == 'tensorrt'
Provides-Extra: tflite
Requires-Dist: tflite-runtime>=2.14.0; extra == 'tflite'
Description-Content-Type: text/markdown

# yolo26-analytics

Real-time object tracking, zone analytics, and event alerting built on YOLO26.

[![CI](https://github.com/MohibShaikh/yolo26-analytics/actions/workflows/ci.yml/badge.svg)](https://github.com/MohibShaikh/yolo26-analytics/actions)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

## What is this?

A pip-installable framework that turns YOLO26 into a production-grade video analytics pipeline. Draw zones, count objects, detect entry/exit, measure dwell time, generate heatmaps, and get real-time alerts — all from a YAML config file.

## Quickstart

```bash
pip install yolo26-analytics
y26a run --source video.mp4 --dashboard
```

Or with Python:

```python
from yolo26_analytics import Pipeline

pipeline = Pipeline.from_yaml("config.yaml")
pipeline.run()
```

Open `http://localhost:8000` to see the live dashboard.

## Architecture

```
VideoSource → Detector → Tracker → ZoneAnalyzer → AlertManager
                            ↓                        ↓
                        TrackStore ←──────── EventStore
                            ↓
                      AnalyticsEngine (heatmaps, dwell, counts)
                            ↓
                        Dashboard (live + replay)
```

Every stage is a Python Protocol. Swap the detector, alert backend, or video source — nothing else changes.

## Features

- **YOLO26 detection** with pluggable model adapters (bring your own model)
- **ByteTrack** multi-object tracking with persistent IDs
- **Zone analytics**: counting, entry/exit, dwell time, throughput
- **Heatmap generation** from accumulated track data
- **4 alert backends**: console, webhook (Slack/Discord), MQTT, Telegram
- **Alert routing** — filter alerts by zone and event type
- **SAHI integration** for small object detection at distance
- **FastAPI dashboard** with live feed, analytics charts, replay, zone editor
- **PostgreSQL** track store for production (SQLite fallback for dev)
- **Model export** to ONNX, TFLite, TensorRT with auto-benchmarking
- **CLI** (`y26a`) and Python API

## Configuration

```yaml
source:
  type: rtsp
  url: rtsp://192.168.1.100/stream

model:
  weights: yolo26n.pt
  confidence: 0.5

zones:
  - name: "Loading Dock"
    polygon: [[100,100], [400,100], [400,400], [100,400]]
    track_classes: [person, forklift]
    analytics:
      - type: count
      - type: dwell
        alert_threshold: 300
      - type: entry_exit

alerts:
  - type: telegram
    bot_token: "YOUR_TOKEN"
    chat_id: "YOUR_CHAT_ID"
  - type: console

dashboard: true
```

See `examples/` for more configurations.

## CLI

```bash
# Run pipeline
y26a run --source video.mp4 --dashboard
y26a run --config config.yaml

# Export model
y26a export --model yolo26n.pt --format onnx
y26a export --model yolo26n.pt --format tflite --quantize int8

# Generate heatmap
y26a heatmap --source video.mp4 --output heatmap.png
```

## Docker

```bash
docker-compose up
```

Starts the app + PostgreSQL. Dashboard at `http://localhost:8000`.

## Roadmap

- [ ] YOLO26-pose for action/posture detection
- [ ] YOLO26-seg for pixel-level analytics
- [ ] Natural language queries over detection history (LLM integration)
- [ ] Active learning: flag low-confidence detections for relabeling
- [ ] Multi-camera orchestration with load balancing
- [ ] Grafana datasource plugin

## License

Apache 2.0
