FlowTraffic OPS

Traffic monitoring & response

—Local
Standby
0
LOCAL TIME--:--:--
Selected feed

Live camera wall

Loading feeds…
MonitoringCamera previewPREVIEW
00:00 / 00:00
Live analysis

Telemetry & Demand

Awaiting telemetry

Congestion trend

Queue & occupancy

QueueOccupancy
FLOWTRAFFIC OPS · APPLICATION GUIDE

Turn camera video
into roadway context.

This example shows how SPE’s tracking and spatial analytics can support a traffic monitoring workflow—from a selected camera feed to lane-level telemetry and incident review.

ONE SELECTED FEED ANALYZEDLOCAL OR SPE ENGINE MODE
VEH 018 · LANE AVEH 042 · LANE DVEH 067 · LANE G SPATIAL GRID · 8 LANES
Tracked objectCalibrated laneCAM-01 / SPATIAL VIEW
01 · APPLICATION OVERVIEW

A single-feed traffic operations workflow

The camera wall reads sources from examples/assets/link.json. Operators select one of six YouTube feeds or the recorded sample, choose a lane preset, and start monitoring.

LIVE FEEDS

YouTube links are resolved to a readable stream. The selected camera is analyzed; other wall tiles remain still previews.

REVIEW

Live sessions run until stopped and keep a rolling replay window. Finite clips can be sampled and exported as JSON reports.

02 · PROCESSING PIPELINE

From pixels to lane-level measures

Each sampled frame moves through detection, tracking, spatial calibration, and application-level traffic analysis.

01

Ingest

Selected camera or recorded clip

link.json · yt-dlp
02

Detect & track

Detections become persistent tracks

SPEClient · Tracker
03

Locate

Map positions into calibrated lanes

SpatialEngine
04

Measure

Aggregate flow and incident signals

Occupancy · crossings
03 · SPE SDK FEATURES

SDK components used by this example

The SDK supplies the tracking and spatial-analysis building blocks. The application connects them into a lane-monitoring workflow.

ComponentRole in the pipelineUsed for
SPEClientCalls the engine’s frame-detection endpoint in server mode.Model-backed detections
ModelAgnosticTrackerAssociates detections over time and maintains track identity.Track history and motion
SpatialEngineCalibrates the camera view and maps object positions to zones and lanes.Lane-aware location
ZoneOccupancyTrackerMaintains occupancy counts for spatial zones.Zone and demand metrics
LineCrossingCounterCounts objects crossing virtual lane lines.Per-lane crossings
summarize_tracksBuilds aggregate statistics from observed tracks.Track summaries
04 · APPLICATION LOGIC

What FlowTraffic adds around SPE

01

Camera operations

Source selection, YouTube stream resolution, live-wall previews, sessions, and replay.

02

Traffic telemetry

Lane aggregation for occupancy, queue length, crossings, congestion, and relative speed.

03

Incident rules

Application policies detect stopped vehicles, queue buildup, network congestion, and lane imbalance.

04

Response guidance

Advisory states and suggested actions are derived from the incident and telemetry history.

Detection modes: Local mode uses a lightweight OpenCV motion detector for demonstration. It is not a trained vehicle-classification model. Server mode sends frames through SPEClient to the configured SPE engine.

05 · CODE WALKTHROUGH

How a frame becomes telemetry

The core loop tracks detections first, spatializes the tracked objects, and then updates occupancy. The web layer aggregates those results into traffic events and advisories.

detections = detector.detect(frame, frame_index, timestamp)
tracked = tracker.update(detections, timestamp)["detections"]
spatial = engine.spatialize_result(
    {"detections": tracked}
)["detections"]
occupancy_snapshot = occupancy.update(spatial, timestamp)
lane_snapshot = build_lane_telemetry(spatial, counters)
incidents = detect_incidents(history, policy)
i

“Relative speed” is indexed to camera calibration and is not a verified real-world speed measurement.