Skip to main content

Zero-Trace Contextual Edge Video Analytics SDK

Project description

FluxState: Edge Intelligence SDK

PyPI version License: MIT

FluxState Edge is an extensible, camera-agnostic video analytics SDK designed for integration into enterprise security backends. It processes RTSP streams locally on the edge, extracting behavioral metadata using a combination of object detection, 3D skeletal posing, and audio processing.

The system is designed to minimize storage overhead by saving structured metadata (JSON telemetry and SQLite logs) rather than raw video footage, making it useful for privacy-conscious environments.


🚀 Core Capabilities

  • Temporal Forensic Database: Events and behavioral anomalies are logged directly into a local SQLite database (core/forensics.py). This allows operators to run SQL or text searches to locate past incidents (e.g., finding instances of specific anomalies or entity interactions) without needing to scrub through hours of video.
  • Hardware Agnostic (RTSP): Connects to existing IP cameras via standard RTSP URLs without requiring proprietary recording hardware.
  • C-Level Memory Mitigation: Python's garbage collector can leave image data in memory longer than desired. FluxState uses ctypes.memset to manually zero out numpy array pixel buffers at the C-level immediately after inference. While OS and GPU drivers may still cache buffers, this mitigates raw image lingering in the Python heap.
  • Over-The-Air (OTA) Policies: Behavioral thresholds and integration webhooks can be updated dynamically via the intelligence_policy.json file. The SDK hot-reloads these parameters without restarting the stream.
  • Headless Telemetry Hooks: Designed to run purely in the background. It emits Python callback events or HTTP POST webhooks when behavioral thresholds are crossed, acting as a data-feed for your own Video Management System (VMS).

📦 Installation & System Requirements

System Dependencies: FluxState relies on native system libraries for optical character recognition and audio streaming.

  • macOS: brew install tesseract portaudio
  • Linux (Ubuntu/Debian): sudo apt-get install tesseract-ocr libportaudio2 libportaudiocpp0 portaudio19-dev

Install the SDK:

pip install fluxstate-edge

🛠️ SDK Integration

FluxState is designed to be embedded into your proprietary backend.

Minimal 5-Line Integration

Create an entrypoint script (e.g., main.py):

import time
from app import FluxStateNode

# Initialize the SDK
sdk = FluxStateNode()

# Define your integration hook
def handle_threat(event_payload):
    print(f"\n[INTEGRATION BUS] Threat Detected! Escalating to VMS...")
    print(f"Target Identity: {event_payload['entities']}")
    print(f"Behavioral Vector: {event_payload['context_log']}")

# Bind the hook to the SDK
sdk.on_threat_detected = handle_threat

# Deploy Headlessly (Runs as a background daemon)
sdk.start_headless_daemon()

try:
    while True: 
        time.sleep(1)
except KeyboardInterrupt:
    print("Shutting down SDK cleanly...")
    sdk.stop()

Forensic Searching

You can query the SQLite database to retrieve past events:

from core.forensics import ForensicDatabase

db = ForensicDatabase()
results = db.query_forensics("ANOMALY")
for timestamp, context in results:
    print(f"[{timestamp}] {context}")

⚙️ Configuration: The Intelligence Policy

FluxState uses a dynamic JSON file (intelligence_policy.json) located in the runtime directory to configure behavioral thresholds.

{
  "SECTOR_ID": "ENTERPRISE-HQ-01",
  "RTSP_STREAM_URL": "0",
  "INTEGRATION_WEBHOOK_URL": "https://api.your-vms.com/v1/telemetry",
  "THREAT_VECTORS": {
    "ARMS_RAISED_OR_REACHING": {
      "enabled": true,
      "escalation_threshold": 0.85
    }
  }
}

🛡️ Architecture Overview

Please refer to the architecture.md file in the source repository for a deeper dive into the threading model, the telemetry pipeline, and the SQLite database schema.

Project details


Download files

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

Source Distribution

fluxstate_edge-1.1.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

fluxstate_edge-1.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file fluxstate_edge-1.1.0.tar.gz.

File metadata

  • Download URL: fluxstate_edge-1.1.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fluxstate_edge-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8cfae4b127afcd075406c9925a5e697f88a3cbf6ee103413aa9fad29b2c9fc8d
MD5 f02977dd7a6fce99ef92c4a6f9b0068e
BLAKE2b-256 c8f974f2e868cbb5a0eca521ef05c9c3f62917a1342ec99e9536eae18537cf35

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxstate_edge-1.1.0.tar.gz:

Publisher: publish.yml on iamrealvinnu/fluxstate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fluxstate_edge-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: fluxstate_edge-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fluxstate_edge-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 794570e6f3ad72cc4a414591a40e3f1ec9a9781905fcd6543a756239c5839b3b
MD5 034eaeffb0aa4b339043acff2cb8b6d2
BLAKE2b-256 33ce3bc00efdabec56265668093d204d066fe0acdd1baad726fdef48017867b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxstate_edge-1.1.0-py3-none-any.whl:

Publisher: publish.yml on iamrealvinnu/fluxstate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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