TrafficAnalytics Examples¶
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:
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r240409 \
/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:r240409 \
/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:
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r240409 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:pass@10.0.0.1: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.
docker run -it --rm \
-v /data:/data -e SIO_DATA_DIR=/data \
us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:r240409 \
/sighthound/sio/bin/runPipeline \
/sighthound/sio/share/pipelines/TrafficAnalytics/TrafficAnalyticsRTSP.yaml \
VIDEO_IN='rtsp://user:pass@10.0.0.1:554/stream_path' \
fpsLimit=15 \
useTracker=true \
updateOnlyOnChange=false \
enabledClasses="['car', 'person']" \
--license-path /data/sighthound-license