Metadata-Version: 2.1
Name: streamgrid
Version: 1.0.11
Summary: Ultra-fast multi-stream: Display multiple video sources with object detection simultaneously using the CPU or GPU device.
Author: Muhammad Rizwan Munawar
Maintainer: Muhammad Rizwan Munawar
Project-URL: Homepage, https://github.com/RizwanMunawar/streamgrid
Project-URL: Repository, https://github.com/RizwanMunawar/streamgrid
Project-URL: Issues, https://github.com/RizwanMunawar/streamgrid/issues
Project-URL: Documentation, https://github.com/RizwanMunawar/streamgrid#readme
Keywords: video,streaming,display,multi-stream,opencv,real-time,python,ultralytics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Multimedia :: Video :: Display
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ultralytics
Requires-Dist: tqdm

# StreamGrid ⚡

Ultra-fast multi-stream video display, Run real-time object detection across multiple video feeds with real-time speed. Whether you're on CPU or GPU, StreamGrid handles the load like a champ.

From smart surveillance to AI-powered dashboards, StreamGrid makes it effortless to display and analyze multiple video streams side-by-side, with [Ultralytics](https://github.com/ultralytics/ultralytics) YOLO-based detection running on all of them in real time.

[![Run CI](https://github.com/RizwanMunawar/streamgrid/actions/workflows/ci.yml/badge.svg)](https://github.com/RizwanMunawar/streamgrid/actions/workflows/ci.yml)
[![PyPI Downloads](https://static.pepy.tech/badge/streamgrid)](https://pepy.tech/projects/streamgrid)
[![PyPI version](https://img.shields.io/pypi/v/streamgrid.svg)](https://pypi.org/project/streamgrid/)
[![Explore streamgrid tech in DeepWiki](https://img.shields.io/badge/Explore-streamgrid_deepwki-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/RizwanMunawar/streamgrid)
<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->

## Installation

```bash
pip install streamgrid
```

## Quick Start

### Python

```python
from ultralytics import YOLO
from streamgrid import StreamGrid

# Load model
model = YOLO("yolo11n.pt")
# model = YOLO("yolo11n_openvino_model")  ~2-3x faster
StreamGrid(model=model)  

# Inference on GPU
StreamGrid(
    sources=[
        "path/to/video1.mp4", "path/to/video2.mp4", 
        "path/to/video3.mp4", "path/to/video4.mp4"
    ], 
    device="cuda")

# Store stream results in CSV file
StreamGrid(sources=sources, analytics=True)
```

### CLI (Command Line Interface)

```bash
streamgrid model=yolo11n.pt

# Run inference with GPU device
streamgrid model=yolo11n.pt device=0  

# save the output
streamgrid model=yolo11n.pt device=cpu save=True

# Pass source
streamgrid model=yolo11n.pt sources=["video1.mp4", "video2.mp4"]

# Store Stream results in CSV file
streamgrid model=yolo11n.pt analytics=True
```

## Performance and reproducible benchmarks

StreamGrid now includes independently paced capture, inference and display, plus per-camera bounded buffers and headless benchmarking. For real-time streams, the default `latest` buffer mode prioritizes fresh frames; `fifo` is available for offline lossless processing. Exported ONNX, OpenVINO, and TensorRT model paths can be loaded through the supported Ultralytics YOLO API. Results depend on hardware, backends, input resolution, batch size, and queue configuration.

Example: `python -m streamgrid.benchmark --sources video1.mp4 video2.mp4 --model yolo11n.pt --buffer-mode fifo --output results.json`

See [Performance Guide](docs/performance.md) for options, metrics, benchmark methodology, and backend compatibility.

## Previous beta performance estimates (not verified against this change)

StreamGrid automatically optimizes performance based on the number of streams:

- **1-2 streams**: 640×360 resolution, up to 15 FPS per stream
- **3-4 streams**: 480×270 resolution, up to 10 FPS total (CPU processing)
- **5-9 streams**: 320×180 resolution, up to 5 FPS per stream
- **10+ streams**: 240×135 resolution, up to 3 FPS per stream

*Note: Performance benchmarks are based on CPU processing. GPU acceleration can significantly improve throughput.*

## Contributing

We welcome contributions! Please feel free to submit a [Pull Request](https://github.com/RizwanMunawar/streamgrid/pulls) or open a [discussion](https://github.com/RizwanMunawar/streamgrid/discussions).
