Zero-copy pinned memory ring buffers, multi-camera RTSP/V4L2 ingestion, INT8 quantized neural acceleration (YOLOv8 / MobileNet), and real-time ByteTrack / DeepSORT tracking for robotics, drones, and edge gateways.
flowchart LR
subgraph Ingestion["1. Zero-Copy Ingestion Layer"]
A[RTSP Stream / IP Cam] --> RB[Zero-Copy Pinned Ring Buffer]
B[Linux V4L2 USB / MIPI] --> RB
C[Video File / Synthetic] --> RB
end
subgraph Neural["2. Neural Accelerator Engines"]
RB --> NPU[EVA Inference Dispatcher]
NPU --> TRT["NVIDIA TensorRT (INT8)"]
NPU --> ORT["ONNX Runtime (DirectML / CPU)"]
NPU --> VINO["Intel OpenVINO / Coral TPU"]
end
subgraph Tracking["3. Continuous Tracking & Post"]
TRT --> POST[Letterbox Unpad + Vectorized NMS]
ORT --> POST
VINO --> POST
POST --> BT[ByteTrack / DeepSORT Tracker]
BT --> SINK[Telemetry / WebRTC / Video Out]
end
- Zero-Copy Memory Ring Buffer: Pre-allocated contiguous memory pools eliminate dynamic memory allocations and Python GC pauses during 4K 60fps/120fps streaming.
- Hardware Agnostic Acceleration: Modular execution backends support NVIDIA TensorRT (INT8/FP16), ONNX Runtime, DirectML, and Intel OpenVINO.
- Edge Detectors: Built-in support for quantized YOLOv8, YOLOv9, YOLOv10, and SSD-MobileNet.
- Real-Time Association: Dual-tier ByteTrack and Appearance-gated DeepSORT multi-object tracking keeping track continuity across occlusions.
- Dual Native C++ / Python Binding: Ultra-low-latency C++17 core engine with PyBind11 bindings for seamless Python ecosystem integration.
Benchmarked on NVIDIA Jetson Orin AGX and x86-64 edge servers (1080p Stream):
| Component | Precision | Latency (ms) | Throughput (FPS) | Bandwidth |
|---|---|---|---|---|
| Zero-Copy Ring Buffer | Memory Pool | 0.18 ms | 1,420 FPS | 8.42 GB/s |
| YOLOv8s Detector | INT8 (TensorRT) | 3.82 ms | 261 FPS | - |
| YOLOv8n Detector | FP16 (CUDA/NPU) | 4.91 ms | 203 FPS | - |
| ByteTrack Association | CPU (50 objects) | 0.31 ms | 3,200 FPS | - |
| End-to-End Pipeline | 1080p INT8 | 5.45 ms | 183 FPS | - |
# Clone the repository
git clone https://github.com/ER-brocode/edge-vision-accelerator.git
cd edge-vision-accelerator
# Install dependencies
pip install -e ".[all]"To build the native high-performance C++17 acceleration module:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Releasefrom edge_vision_accelerator import (
ZeroCopyFrameRingBuffer,
RTSPStreamIngestor,
QuantizedYOLODetector,
ByteTracker
)
# 1. Initialize pre-allocated 1080p frame buffer (16 frames capacity)
ring_buffer = ZeroCopyFrameRingBuffer(capacity=16, height=1080, width=1920, channels=3)
# 2. Ingest camera stream in background worker thread
ingestor = RTSPStreamIngestor(
rtsp_url="rtsp://192.168.1.100:554/live/ch0",
ring_buffer=ring_buffer,
target_fps=30.0
)
ingestor.start()
# 3. Setup INT8 Quantized Detector and ByteTracker
detector = QuantizedYOLODetector(model_path="models/yolov8n_int8.onnx")
tracker = ByteTracker(track_thresh=0.5, match_thresh=0.8)
# 4. Low-latency inference loop
try:
while True:
frame = ring_buffer.get_frame(timeout=0.1)
if frame is None:
continue
# Zero-copy inference pass
detections = detector.detect(frame.data)
# Multi-object tracking update
active_tracks = tracker.update(detections)
for track in active_tracks:
print(f"Track ID #{track.track_id}: {track.label} at {track.bbox} ({track.confidence:.2f})")
finally:
ingestor.stop()edge-vision-accelerator/
├── CMakeLists.txt # Native C++ build configuration
├── pyproject.toml # PEP 621 Python package configuration
├── .github/
│ └── workflows/ci.yml # Cross-platform CI/CD automation matrix
├── cpp/
│ ├── include/eva/
│ │ ├── types.hpp # Rect, Detection, TrackedObject, FrameMeta
│ │ ├── ring_buffer.hpp # Lock-free zero-copy circular ring buffer
│ │ ├── accelerator.hpp # IEvaAccelerator C++ engine interface
│ │ └── byte_track.hpp # Native C++ ByteTrack Kalman implementation
│ ├── src/
│ │ └── accelerator.cpp # Native C++ inference implementation
│ └── bindings/
│ └── eva_bindings.cpp # PyBind11 bindings for _eva_cpp
├── edge_vision_accelerator/
│ ├── __init__.py # Package exports
│ ├── pipeline/
│ │ ├── frame.py # Zero-copy Frame & metadata
│ │ ├── ring_buffer.py # Pre-allocated circular ring buffer
│ │ └── ingestion.py # RTSP & V4L2 background ingestors
│ ├── inference/
│ │ ├── engine.py # ONNXRuntime / TensorRT engine wrapper
│ │ └── detector.py # Quantized YOLOv8 and MobileNet detector
│ └── tracker/
│ ├── kalman.py # Discrete 8-state Kalman Filter
│ ├── matching.py # Hungarian / Lapjv matching utilities
│ ├── byte_track.py # Multi-Object ByteTrack
│ └── deep_sort.py # DeepSORT appearance-gated tracking
├── tests/
│ ├── test_pipeline.py # Ring buffer overflow & frame view tests
│ ├── test_inference.py # Quantized INT8 detector & NMS tests
│ ├── test_tracker.py # ByteTrack & DeepSORT association tests
│ └── cpp_tests.cpp # C++ unit test suite
├── benchmarks/
│ └── benchmark_pipeline.py # Memory bandwidth & tracking throughput benchmark
└── examples/
└── run_edge_pipeline.py # End-to-end edge pipeline example
Run the automated test suite:
pytest tests/ -vExecute hardware throughput benchmark:
python benchmarks/benchmark_pipeline.pyThis project is licensed under the Apache 2.0 License - see the LICENSE file for details.
