For AI agents: a documentation index is available at /llms.txt. Markdown versions are available at matching .md URLs.

Skip to content

TrafficAnalytics Examples

SIO examples

Process images, videos, and RTSP streams with the SIO TrafficAnalytics folder watcher and live stream pipelines.

Folder watcher

Watch an input folder for image or video files and process new media with configurable filters.

Traffic classes

Analyze traffic-oriented object classes such as bicycles, buses, cars, motorbikes, people, and trucks.

RTSP streams

Run live stream examples with frame rate, tracker, update, and class-selection parameters.

See the TrafficAnalytics pipeline reference for a complete list of available options and pipelines.

TrafficAnalytics Folder Watcher

  • Designed to process images and videos using a configured "watched" folder as an input

  • Pipeline checks the "watched" folder for files periodically (the time interval is configurable)

  • Pipeline name: TrafficAnalyticsFolderWatch.yaml

  • Location: ./share/pipelines/TrafficAnalytics/TrafficAnalyticsFolderWatch.yaml

  • Required parameters: folderPath='Valid_Folder_Path'

  • A valid folder path is required. By default, the pipeline only considers images with .jpg, .png, .mp4, .mkv extensions, but this can be configured.

Examples

The following examples use the folder watcher pipeline to process files from a specific folder.

The simplest command using the default options:

./bin/runPipeline \
./share/pipelines/TrafficAnalytics/TrafficAnalyticsFolderWatch.yaml \
folderPath='/data/watched'
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r260204 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsFolderWatch.yaml \
folderPath='/data/watched' \
--license-path /data/sighthound-license

In the example below, the pipeline is set to only process files with .jpg and .png file extensions. Box filtering is used to filter out any classes besides car and truck, and boxFilterROI ensures that each type of object is contained in the respective region of interest (ROI). The ROI is interpreted as x, y, width, height.

./bin/runPipeline \
./share/pipelines/VehicleAnalytics/VehicleAnalyticsFolderWatch.yaml \
folderPath='/data/watched' \
folderPollExtensions="[ 'jpg', 'png' ]" \
boxFilterClasses="[ 'car', 'truck' ]" \
boxFilterROI='[ [ 10, 10, 100, 100 ], [ 20, 20, 120, 120 ] ]' \
boxFilterMin='[ 40, 40 ]' \
boxFilterMax='[ 0, 0 ]'
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r260204 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsFolderWatch.yaml \
folderPath='/data/watched' \
folderPollExtensions="[ 'jpg', 'png' ]" \
boxFilterClasses="[ 'car', 'truck' ]" \
boxFilterROI='[ [ 10, 10, 100, 100 ], [ 20, 20, 120, 120 ] ]' \
boxFilterMin='[ 40, 40 ]' \
boxFilterMax='[ 0, 0 ]' \
--license-path /data/sighthound-license

TrafficAnalytics RTSP

Designed to process RTSP video streams.

Pipeline name: TrafficAnalyticsRTSP.yaml

Location: ./share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml

Required parameters: VIDEO_IN='RTSP_URL'

Requires a valid RTSP video stream. Example: rtsp://10.0.0.1:554/stream_path

Examples

The following examples show how to process a live RTSP video stream to get traffic analytics on the object classes [ "bicycle", "bus", "car", "motorbike", "person", "truck" ].

The simplest command using the default options:

./bin/runPipeline \
./share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:[email protected]:554/stream_path'
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r260204 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:[email protected]:554/stream_path' \
--license-path /data/sighthound-license

In the next example, we process the live stream at 15fps and enable the object tracker by setting The useTracker parameter. The updateOnlyOnChange parameter is disabled to get analytics for every frame, even if there are no changes in the results for each processed frame. Only the "person" and "car" classes are enabled.

./bin/runPipeline \
./share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:[email protected]:554/stream_path' \
fpsLimit=15 \
useTracker=true \
updateOnlyOnChange=false \
enabledClasses="['car', 'person']"
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r260204 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:[email protected]:554/stream_path' \
fpsLimit=15 \
useTracker=true \
updateOnlyOnChange=false \
enabledClasses="['car', 'person']" \
--license-path /data/sighthound-license